throw new Error('asdasdad')
这样会返回{
error: asdasdad, error_code: 500,
}
如何指定error_code呢?
例如 throw new Error('asdasdad', 400)
光阴似箭催人老,日月如移越少年。
Error를 상속받는 클래스를 작성하세요. 예:
기본 클래스 내보내기 ApiError는 오류 {를 확장합니다. 생성자(메시지, 코드) { 슈퍼(메시지); this.msg = 메시지; this.code = 코드; } }
Error를 상속받는 클래스를 작성하세요. 예: