Common utilities for error handling within Backstage with structured error classes and serialization functions
63
A utility for wrapping upstream failures with local context while surfacing the original error type.
wrapUpstreamError("sync catalog", cause) returns an error whose name remains "ValidationError" and whose message contains both "sync catalog" and "payload missing". @testError instance as its cause, preserving identity for debugging and logging. @testError (for example, a string "timeout"), the wrapper uses name value "Error" and the message still includes the provided context plus the stringified cause. @test@generates
/**
* Wraps an upstream failure with local context while keeping the upstream type visible.
*/
export function wrapUpstreamError(step: string, cause: unknown): Error;Utilities for wrapping underlying causes with contextual messages while surfacing upstream error types.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-backstage--errorsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10