File tree 1 file changed +10
-10
lines changed
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
1
export async function UnauthorizedException ( ) {
2
2
return new Response (
3
3
JSON . stringify ( {
4
- reason : 'Unauthorized' ,
4
+ message : 'Unauthorized' ,
5
5
} ) ,
6
6
{
7
7
status : 401 ,
8
8
statusText : 'Unauthorized' ,
9
9
headers : {
10
10
'Content-Type' : 'application/json' ,
11
11
} ,
12
- } ,
12
+ }
13
13
) ;
14
14
}
15
15
16
16
export async function NotFoundException ( ) {
17
17
return new Response (
18
18
JSON . stringify ( {
19
- reason : 'Not Found' ,
19
+ message : 'Not Found' ,
20
20
} ) ,
21
21
{
22
22
status : 404 ,
23
23
statusText : 'Bad Request' ,
24
24
headers : {
25
25
'Content-Type' : 'application/json' ,
26
26
} ,
27
- } ,
27
+ }
28
28
) ;
29
29
}
30
30
31
- export async function BadRequestException ( reason : string ) {
31
+ export async function BadRequestException ( message : string ) {
32
32
return new Response (
33
33
JSON . stringify ( {
34
- reason ,
34
+ message ,
35
35
} ) ,
36
36
{
37
37
status : 400 ,
38
38
statusText : 'Bad Request' ,
39
39
headers : {
40
40
'Content-Type' : 'application/json' ,
41
41
} ,
42
- } ,
42
+ }
43
43
) ;
44
44
}
45
45
46
- export async function ServerException ( reason : string ) {
46
+ export async function ServerException ( message : string ) {
47
47
return new Response (
48
48
JSON . stringify ( {
49
- reason ,
49
+ message ,
50
50
} ) ,
51
51
{
52
52
status : 500 ,
53
53
statusText : 'Internal Server Error' ,
54
54
headers : {
55
55
'Content-Type' : 'application/json' ,
56
56
} ,
57
- } ,
57
+ }
58
58
) ;
59
59
}
60
60
You can’t perform that action at this time.
0 commit comments