MCPcopy
hub / github.com/blitz-js/blitz / registerBlitzErrorClasses

Function registerBlitzErrorClasses

packages/blitz/src/errors.ts:94–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92let _blitzErrorClassRegistered = false
93
94export function registerBlitzErrorClasses() {
95 if (_blitzErrorClassRegistered || !isNotInUserTestEnvironment()) return
96 SuperJson.registerClass(AuthenticationError, {
97 identifier: "BlitzAuthenticationError",
98 allowProps: errorProps,
99 })
100
101 SuperJson.registerClass(CSRFTokenMismatchError, {
102 identifier: "BlitzCSRFTokenMismatchError",
103 allowProps: errorProps,
104 })
105
106 SuperJson.registerClass(AuthorizationError, {
107 identifier: "BlitzAuthorizationError",
108 allowProps: errorProps,
109 })
110
111 SuperJson.registerClass(NotFoundError, {
112 identifier: "BlitzNotFoundError",
113 allowProps: errorProps,
114 })
115
116 SuperJson.registerClass(RedirectError, {
117 identifier: "BlitzRedirectError",
118 allowProps: errorProps,
119 })
120
121 SuperJson.registerClass(PaginationArgumentError, {
122 identifier: "BlitzPaginationArgumentError",
123 allowProps: errorProps,
124 })
125
126 SuperJson.registerClass(OAuthError, {
127 identifier: "OAuthError",
128 allowProps: errorProps,
129 })
130
131 _blitzErrorClassRegistered = true
132}
133
134registerBlitzErrorClasses()

Callers 3

rpcHandlerFunction · 0.90
rpcAppHandlerFunction · 0.90
errors.tsFile · 0.85

Calls 1

Tested by

no test coverage detected