ren-framework
Version:
42 lines (38 loc) • 850 B
JavaScript
const HttpError = require('./HttpError');
/**
* UnprocessableEntityError
* 消息体不能处理错误
* ------------------------
* @author Verdient。
*/
class UnprocessableEntityError extends HttpError
{
/**
* constructor(String message, Mixed data)
* 构造函数
* ---------------------------------------
* @param {String} message 错误信息
* @param {Mixed} data 附加的数据
* -------------------------------
* @inheritdoc
* -----------
* @author Verdient。
*/
constructor(message, data){
super(message || 'Unprocessable Entity', 422, data);
}
/**
* @getter type()
* 获取错误类型
* --------------
* @inheritdoc
* -----------
* @return {String}
* @author Verdient。
*/
get type(){
return 'Unprocessable Entity Error';
}
}
module.exports = UnprocessableEntityError;