HttpError
A failure meant for the caller: its status and message reach the browser (other errors are hidden in production).
It runs anywhere, so browser code can tell one apart (error.name === "HttpError", error.status).
export class HttpError extends Error { readonly status: number; /** seconds, sent as Retry-After (429s from rateLimit set it) */ readonly retryAfter?: number; constructor(status: number, message: string, opts: { retryAfter?: number } = {}) { super(message); this.name = "HttpError"; this.status = status; if (opts.retryAfter !== undefined) this.retryAfter = opts.retryAfter; // what tcm's runtime knows a deliberate error by, whichever copy of this class made it (this as unknown as Record<symbol, boolean>)[Symbol.for("tcm.httpError")] = true; } }
used by
- tcmts.atproto.accountOf
- tcmts.atproto.lib.server.Table
- tcmts.atproto.lib.server.rateLimit
- tcmts.atproto.lib.server.test.testRateLimitsAreDeliberateErrors
- tcmts.atproto.lib.server.test.testTablesCheckTheirRows
- tcmts.atproto.takeSignIn
- tcmts.registry.restar
- tcmts.registry.session.codebaseHere
- tcmts.share.actOn
- tcmts.share.codeMap
- tcmts.share.codeMapDoc
- tcmts.share.searchFor
- tcmts.share.signIn
- tcmts.studio.ScratchPage
- tcmts.studio.addLib
- tcmts.studio.announceRelease
- tcmts.studio.branchingCodebase
- tcmts.studio.cancelJob
- tcmts.studio.editDefinition
- tcmts.studio.editableCodebase
- tcmts.studio.evaluateInScratch
- tcmts.studio.extractInScratch
- tcmts.studio.fetchProduction
- tcmts.studio.makeBranch
- tcmts.studio.makeRelease
- tcmts.studio.migrateTable
- tcmts.studio.previewInScratch
- tcmts.studio.pullIntoScratch
- tcmts.studio.readBranch
- tcmts.studio.removeDefinition
- tcmts.studio.removeRow
- tcmts.studio.renameDefinition
- tcmts.studio.renameInScratch
- tcmts.studio.retryJob
- tcmts.studio.runTestInScratch
- tcmts.studio.saveRow
- tcmts.studio.scratchPath
- tcmts.studio.setProduction
- tcmts.studio.startApp
- tcmts.studio.startMerge
- tcmts.studio.startTests
- tcmts.studio.switchBranch
- tcmts.studio.tcmSaid
- tcmts.studio.updateScratch
- tcmts.studio.upgradePackage
- tcmts.studio.writeReleaseSummary