Better error messages

This commit is contained in:
Douglas Barone 2023-10-24 08:36:44 -04:00
parent fd516eecb3
commit 7a892747d4
3 changed files with 3 additions and 3 deletions

View File

@ -10,6 +10,6 @@ export class FakeAuth implements Auth {
username: 'test',
domain: 'test_domain'
}
throw new Error('Login failed')
throw new Error('Fake login failed')
}
}

View File

@ -26,7 +26,7 @@ export class LdapAuth implements Auth {
} catch (error: any) {
console.log('Error:', error)
throw new Error(`Login failed: ${error.message}`)
throw new Error(`Ldap login failed: ${error.message}`)
} finally {
await this.client.unbind()
}

View File

@ -23,6 +23,6 @@ export async function login(username: string, password: string, ip: string) {
return user
} catch (error: any) {
console.log(error.message)
throw new Error(`Login failed: ${error.message}`)
throw new Error(`Login procedure failed: ${error.message}`)
}
}