From a39ff0c10e7e1e94d89af8ffdc3bff64230228e3 Mon Sep 17 00:00:00 2001 From: Pawel Idczak Date: Sun, 25 Feb 2024 22:35:16 +0100 Subject: [PATCH] simplify error messages --- src/bir.ts | 2 +- src/extract.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bir.ts b/src/bir.ts index 6fdd826..1e6e04b 100644 --- a/src/bir.ts +++ b/src/bir.ts @@ -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 } diff --git a/src/extract.ts b/src/extract.ts index d5decce..841f1dc 100644 --- a/src/extract.ts +++ b/src/extract.ts @@ -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] }