fix: return error code when trace log not foundd (#6168)

This commit is contained in:
zhongwencool 2021-11-15 17:41:22 +08:00 committed by GitHub
parent 23e2bd62c5
commit 96d2615cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -88,8 +88,11 @@ update_trace(Path, Params) ->
download_zip_log(Path, Params) ->
case emqx_trace_api:download_zip_log(Path, Params) of
{ok, File} -> minirest:return_file(File);
{error, _Reason} = Err -> return(Err)
{error, Reason} -> return({error, 'NOT_FOUND', Reason})
end.
stream_log_file(Path, Params) ->
return(emqx_trace_api:stream_log_file(Path, Params)).
case emqx_trace_api:stream_log_file(Path, Params) of
{ok, File} -> return({ok, File});
{error, Reason} -> return({error, 'NOT_FOUND', Reason})
end.