Better error handling
This commit is contained in:
parent
b390363b25
commit
e3b3f8fac1
25 changed files with 52 additions and 52 deletions
|
|
@ -14,7 +14,7 @@ export default async (token: string): Promise<[User | null | undefined, App | nu
|
|||
.findOne({ token });
|
||||
|
||||
if (user == null) {
|
||||
throw 'user not found';
|
||||
throw new Error('user not found');
|
||||
}
|
||||
|
||||
return [user, null];
|
||||
|
|
@ -24,7 +24,7 @@ export default async (token: string): Promise<[User | null | undefined, App | nu
|
|||
});
|
||||
|
||||
if (accessToken == null) {
|
||||
throw 'invalid signature';
|
||||
throw new Error('invalid signature');
|
||||
}
|
||||
|
||||
const app = await Apps
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue