@bearei/ali-serverless
Advanced tools
Comparing version 1.0.0 to 1.0.1
import { Err } from '@bearei/ei'; | ||
import { HttpTriggerInvokeOptions } from './invoke'; | ||
export type CreateProcessInvokeErrorOptions = Pick<HttpTriggerInvokeOptions, 'serviceName' | 'functionName'> & Partial<Pick<HttpTriggerInvokeOptions, 'path'>>; | ||
export interface ProcessErrorOptions extends CreateProcessInvokeErrorOptions { | ||
/** | ||
* The request ID for the current invocation of the Serverless function | ||
*/ | ||
requestId?: string; | ||
} | ||
export interface ServerlessErr extends Err, Partial<ProcessErrorOptions> { | ||
@@ -7,3 +14,3 @@ /** | ||
*/ | ||
code?: number; | ||
code?: number | string; | ||
/** | ||
@@ -18,14 +25,7 @@ * Serverless function call error. | ||
} | ||
export type CreateProcessInvokeErrorOptions = Pick<HttpTriggerInvokeOptions, 'serviceName' | 'functionName'> & Partial<Pick<HttpTriggerInvokeOptions, 'path'>>; | ||
export interface ProcessErrorOptions extends CreateProcessInvokeErrorOptions { | ||
/** | ||
* The request ID for the current invocation of the Serverless function | ||
*/ | ||
requestId?: string; | ||
} | ||
export interface CreatedError { | ||
createProcessInvokeError: typeof createProcessInvokeError; | ||
} | ||
declare const createProcessInvokeError: (options: CreateProcessInvokeErrorOptions) => (error: Err) => never; | ||
declare const createProcessInvokeError: (options: CreateProcessInvokeErrorOptions) => (error: ServerlessErr) => never; | ||
export declare const ERROR: CreatedError; | ||
export {}; |
@@ -24,6 +24,6 @@ /******/ (function() { // webpackBootstrap | ||
path = _ref.path; | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
var status = (_a = error.status) !== null && _a !== void 0 ? _a : 500; | ||
var statusText = (_b = error.statusText) !== null && _b !== void 0 ? _b : ''; | ||
var code = error.code && typeof error.code === 'number' ? error.code : status; | ||
var code = ((_c = error.code) !== null && _c !== void 0 ? _c : typeof error.code === 'number') ? error.code : status; | ||
var err = error.status ? error : { | ||
@@ -37,3 +37,3 @@ error: error | ||
}]; | ||
var message = (_c = error.message) !== null && _c !== void 0 ? _c : "".concat(serviceName, ".").concat(functionName, ".").concat(path, " invoke failed"); | ||
var message = (_d = error.message) !== null && _d !== void 0 ? _d : "".concat(serviceName, ".").concat(functionName, ".").concat(path, " invoke failed"); | ||
var chains = err.chains && Array.isArray(err.chains) ? [].concat(currentChains, _toConsumableArray(err.chains)) : currentChains; | ||
@@ -40,0 +40,0 @@ return Object.assign(new Error(), Object.assign(Object.assign({}, err), { |
import { Err } from '@bearei/ei'; | ||
import { HttpTriggerInvokeOptions } from './invoke'; | ||
export type CreateProcessInvokeErrorOptions = Pick<HttpTriggerInvokeOptions, 'serviceName' | 'functionName'> & Partial<Pick<HttpTriggerInvokeOptions, 'path'>>; | ||
export interface ProcessErrorOptions extends CreateProcessInvokeErrorOptions { | ||
/** | ||
* The request ID for the current invocation of the Serverless function | ||
*/ | ||
requestId?: string; | ||
} | ||
export interface ServerlessErr extends Err, Partial<ProcessErrorOptions> { | ||
@@ -7,3 +14,3 @@ /** | ||
*/ | ||
code?: number; | ||
code?: number | string; | ||
/** | ||
@@ -18,14 +25,7 @@ * Serverless function call error. | ||
} | ||
export type CreateProcessInvokeErrorOptions = Pick<HttpTriggerInvokeOptions, 'serviceName' | 'functionName'> & Partial<Pick<HttpTriggerInvokeOptions, 'path'>>; | ||
export interface ProcessErrorOptions extends CreateProcessInvokeErrorOptions { | ||
/** | ||
* The request ID for the current invocation of the Serverless function | ||
*/ | ||
requestId?: string; | ||
} | ||
export interface CreatedError { | ||
createProcessInvokeError: typeof createProcessInvokeError; | ||
} | ||
declare const createProcessInvokeError: (options: CreateProcessInvokeErrorOptions) => (error: Err) => never; | ||
declare const createProcessInvokeError: (options: CreateProcessInvokeErrorOptions) => (error: ServerlessErr) => never; | ||
export declare const ERROR: CreatedError; | ||
export {}; |
@@ -38,6 +38,6 @@ /******/ // The require scope | ||
path = _ref.path; | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
var status = (_a = error.status) !== null && _a !== void 0 ? _a : 500; | ||
var statusText = (_b = error.statusText) !== null && _b !== void 0 ? _b : ''; | ||
var code = error.code && typeof error.code === 'number' ? error.code : status; | ||
var code = ((_c = error.code) !== null && _c !== void 0 ? _c : typeof error.code === 'number') ? error.code : status; | ||
var err = error.status ? error : { | ||
@@ -51,3 +51,3 @@ error: error | ||
}]; | ||
var message = (_c = error.message) !== null && _c !== void 0 ? _c : "".concat(serviceName, ".").concat(functionName, ".").concat(path, " invoke failed"); | ||
var message = (_d = error.message) !== null && _d !== void 0 ? _d : "".concat(serviceName, ".").concat(functionName, ".").concat(path, " invoke failed"); | ||
var chains = err.chains && Array.isArray(err.chains) ? [].concat(currentChains, _toConsumableArray(err.chains)) : currentChains; | ||
@@ -54,0 +54,0 @@ return Object.assign(new Error(), Object.assign(Object.assign({}, err), { |
{ | ||
"name": "@bearei/ali-serverless", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"main": "./lib/commonjs/index", | ||
@@ -25,3 +25,3 @@ "module": "./lib/module/index", | ||
"dependencies": { | ||
"@bearei/ei": "^1.2.1" | ||
"@bearei/ei": "^1.2.2" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
576942
Updated@bearei/ei@^1.2.2