@solid/community-server
Version:
Community Solid Server: an open and modular implementation of the Solid specifications
17 lines • 492 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureHttpError = ensureHttpError;
const HttpErrorUtil_1 = require("../errors/HttpErrorUtil");
/**
* Makes sure that if the given function rejects with an error,
* an {@link HttpError} will be used.
*/
async function ensureHttpError(fn) {
try {
return await fn();
}
catch (error) {
throw (0, HttpErrorUtil_1.toHttpError)(error);
}
}
//# sourceMappingURL=HandlerUtil.js.map