Skip to content

Commit

Permalink
simplify error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-id committed Feb 25, 2024
1 parent 3463adf commit a39ff0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class Bir {
const body = template.Zaloguj({ key: this.key })
const response = await this.api({ body })
const sid = unsoap(response)
assert(sid, new BirError('Login failed, no session found in response'))
assert(sid, new BirError('Login failed, no session found'))
this.sid = sid
}

Expand Down
2 changes: 1 addition & 1 deletion src/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BirError } from './error.js'

export function unsoap(string: string) {
const match = /<\S+Result>(.+)<\/\S+Result>/s.exec(string)
assert(match?.[1], new BirError('SOAP Result empty or not found in response'))
assert(match?.[1], new BirError('Empty response'))
return match[1]
}

Expand Down

0 comments on commit a39ff0c

Please sign in to comment.