0.0.4-alpha.38 • Published 3 years ago
@serverless-devs/http-error-handler v0.0.4-alpha.38
设计原则
Fc 函数计算的参数格式为(req, res, context)
。第一个参数 req 的参数类型为 readable Stream。将 req 转换为 JSON Object 的类型
基础使用方式
请求报错时,可以正常返回报错信息
'use strict';
const dk = require('@serverless-devs/dk-core');
const httpErrorHandler = require('@serverless-devs/http-error-handler');
const handler = dk((request) => {
throw new Error();
});
handler.use(httpErrorHandler());
exports.handler = handler;
高级使用方式
0.0.4-alpha.38
3 years ago
0.0.4-alpha.37
3 years ago
0.0.4-alpha.36
3 years ago
0.0.4-alpha.35
3 years ago
0.0.4-alpha.32
3 years ago
0.0.4-alpha.34
3 years ago
0.0.4-alpha.31
3 years ago
0.0.4-alpha.29
3 years ago
0.0.4-alpha.28
3 years ago
0.0.4-alpha.27
3 years ago
0.0.4-alpha.26
3 years ago