Files
slm-design/.templates/rest-api/{{name.kebabCase}}-rest-api/errors/{{name.kebabCase}}-rest-api-transport.error.ts
2026-08-01 09:31:08 +03:00

21 lines
722 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Причина сбоя непосредственно на transport-границе {{name.pascalCase}} REST API.
*/
export type {{name.pascalCase}}RestApiTransportErrorCode = 'NETWORK_UNAVAILABLE' | 'REQUEST_TIMEOUT'
/**
* Маркирует fetch failure, не смешивая его с TypeError из прикладного кода.
*/
export class {{name.pascalCase}}RestApiTransportError extends Error {
readonly code: {{name.pascalCase}}RestApiTransportErrorCode
readonly cause: unknown
constructor(code: {{name.pascalCase}}RestApiTransportErrorCode, cause: unknown) {
super(code)
this.name = '{{name.pascalCase}}RestApiTransportError'
this.code = code
this.cause = cause
}
}