Better error handling
This commit is contained in:
parent
b390363b25
commit
e3b3f8fac1
25 changed files with 52 additions and 52 deletions
|
@ -36,7 +36,7 @@ export async function getRemoteUser(userId: User['id']) {
|
|||
const user = await getUser(userId);
|
||||
|
||||
if (!Users.isRemoteUser(user)) {
|
||||
throw 'user is not a remote user';
|
||||
throw new Error('user is not a remote user');
|
||||
}
|
||||
|
||||
return user;
|
||||
|
@ -49,7 +49,7 @@ export async function getLocalUser(userId: User['id']) {
|
|||
const user = await getUser(userId);
|
||||
|
||||
if (!Users.isLocalUser(user)) {
|
||||
throw 'user is not a local user';
|
||||
throw new Error('user is not a local user');
|
||||
}
|
||||
|
||||
return user;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue