Initial commit: Book management system with Rust Loco backend and Vue 3 frontend
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
import { config } from '../config';
|
||||
let context = null;
|
||||
export function errorContext(cb) {
|
||||
if (config.useDeprecatedSynchronousErrorHandling) {
|
||||
const isRoot = !context;
|
||||
if (isRoot) {
|
||||
context = { errorThrown: false, error: null };
|
||||
}
|
||||
cb();
|
||||
if (isRoot) {
|
||||
const { errorThrown, error } = context;
|
||||
context = null;
|
||||
if (errorThrown) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
cb();
|
||||
}
|
||||
}
|
||||
export function captureError(err) {
|
||||
if (config.useDeprecatedSynchronousErrorHandling && context) {
|
||||
context.errorThrown = true;
|
||||
context.error = err;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=errorContext.js.map
|
||||
Reference in New Issue
Block a user