public
/
ndcode_site.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
58b06e3e60615d1694cfe14ffec103572680316b
[ndcode_site.git]
/
_config
/
Problem.mjs
1
let Problem = class {
2
constructor(title, detail, status) {
3
this.title = title
4
this.detail = detail
5
this.status = status
6
}
7
8
static from(error) {
9
return (
10
error instanceof Problem ?
11
error :
12
new Problem('Bad request', error.message, 400)
13
)
14
}
15
}
16
17
export default Problem