public
/
ndcode_site.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Fix unnecessary extra syntax in /_config/Problem.mjs
[ndcode_site.git]
/
_config
/
Problem.mjs
1
class Problem {
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.stack || error.message), 400)
13
)
14
}
15
}
16
17
export default Problem