mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
add tracing tags
This commit is contained in:
@@ -45,15 +45,16 @@ export class HttpService {
|
||||
|
||||
return ok (result as T)
|
||||
} catch (e) {
|
||||
tracing?.setAttribute('url', url)
|
||||
if(isHttpError(e)) {
|
||||
tracing?.setAttribute('status.code', e.status.toString())
|
||||
if (e.status == 400) {
|
||||
tracing?.setAttribute('outcome', 'failed')
|
||||
}
|
||||
} else {
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
tracing?.setAttribute('map.error', 'true')
|
||||
tracing?.setAttribute('map.error.context', JSON.stringify(e))
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
}
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user