@webfaas/webfaas-core
Version:
WebFaaS Framework - Core
114 lines • 3.77 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebFaasError = void 0;
var WebFaasError;
(function (WebFaasError) {
//
//NotFoundError
//
let NotFoundErrorTypeEnum;
(function (NotFoundErrorTypeEnum) {
NotFoundErrorTypeEnum["TARBALL"] = "TARBALL";
NotFoundErrorTypeEnum["MANIFEST"] = "MANIFEST";
NotFoundErrorTypeEnum["VERSION"] = "VERSION";
NotFoundErrorTypeEnum["DEPENDENCY"] = "DEPENDENCY";
NotFoundErrorTypeEnum["METHOD"] = "METHOD";
})(NotFoundErrorTypeEnum = WebFaasError.NotFoundErrorTypeEnum || (WebFaasError.NotFoundErrorTypeEnum = {}));
class NotFoundError extends Error {
constructor(type, artefactName) {
super(type.toString() + " NOT FOUND");
this.name = "NotFoundError";
this.type = type;
this.artefactName = artefactName;
}
}
WebFaasError.NotFoundError = NotFoundError;
//
//ClientHttpError
//
class ClientHttpError extends Error {
constructor(err, url, method) {
super(err.message);
let genericErr = err;
this.name = "ClientHttpError";
this.code = genericErr.code;
this.stack = err.stack;
this.url = url;
this.method = method || "GET";
}
}
WebFaasError.ClientHttpError = ClientHttpError;
//
//CompileError
//
class CompileError extends Error {
constructor(err) {
super(err.message);
let genericErr = err;
this.name = "CompileError";
this.code = genericErr.code;
this.stack = err.stack;
}
}
WebFaasError.CompileError = CompileError;
//
//FileError
//
class FileError extends Error {
constructor(err) {
super(err.message);
let genericErr = err;
this.name = "FileError";
this.code = genericErr.code;
this.stack = err.stack;
}
}
WebFaasError.FileError = FileError;
//
//InvokeError
//
class InvokeError extends Error {
constructor(err) {
super(err.message);
let genericErr = err;
this.name = "InvokeError";
this.code = genericErr.code;
this.stack = err.stack;
}
}
WebFaasError.InvokeError = InvokeError;
//
//SecurityError
//
let SecurityErrorTypeEnum;
(function (SecurityErrorTypeEnum) {
SecurityErrorTypeEnum["MISSING_CREDENTIALS"] = "MISSING_CREDENTIALS";
SecurityErrorTypeEnum["INVALID_CREDENTIALS"] = "INVALID_CREDENTIALS";
SecurityErrorTypeEnum["FORBIDDEN"] = "FORBIDDEN";
SecurityErrorTypeEnum["THROTTLED"] = "THROTTLED";
SecurityErrorTypeEnum["PAYLOAD_LARGE"] = "PAYLOAD_LARGE";
SecurityErrorTypeEnum["PAYLOAD_INVALID"] = "PAYLOAD_INVALID";
SecurityErrorTypeEnum["UNCLASSIFIED"] = "UNCLASSIFIED";
})(SecurityErrorTypeEnum = WebFaasError.SecurityErrorTypeEnum || (WebFaasError.SecurityErrorTypeEnum = {}));
class SecurityError extends Error {
constructor(type, message) {
super(message);
this.name = "SecurityError";
this.type = type;
}
}
WebFaasError.SecurityError = SecurityError;
//
//ValidateError
//
class ValidateError extends Error {
constructor(code, field, message) {
super(message);
this.name = "ValidateError";
this.field = field;
this.code = code;
}
}
WebFaasError.ValidateError = ValidateError;
})(WebFaasError = exports.WebFaasError || (exports.WebFaasError = {}));
//# sourceMappingURL=WebFaasError.js.map