Skip to main content

Function: createErrorAttributes()

@arolariu/website


@arolariu/website / instrumentation.server / createErrorAttributes

Function: createErrorAttributes()

createErrorAttributes(error, handled): ErrorAttributes

Defined in: instrumentation.server.ts:876

Create error semantic attributes from an error object.

Parameters

error

unknown

Error object or unknown value

handled

boolean

Whether the error was handled

Returns

ErrorAttributes

Type-safe error attributes

Example

try {
await riskyOperation();
} catch (error) {
const attrs = createErrorAttributes(error, true);
logWithTrace('error', 'Operation failed', attrs);
}
// was this page useful?