Skip to content

Commit

Permalink
Correct error handling for TypeScript 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jessety committed Aug 21, 2022
1 parent b3a99ef commit b9cd361
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class Client {

try {
value = JSON.stringify(value);
} catch (e) {
} catch (e: any) {
const error = new ExtendedError(`Could not serialize parameter ${key}: ${e.message}`);
error.code = 'EBADINPUT';
error.details = e;
Expand Down Expand Up @@ -301,7 +301,7 @@ class Client {
bodyData = JSON.stringify(data);
headers['content-type'] = 'application/json';

} catch (e) {
} catch (e: any) {

const error = new ExtendedError(`Could not serialize input data: ${e.message}`);
error.code = 'EBADINPUT';
Expand Down
2 changes: 1 addition & 1 deletion src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class SimpleHMACAuth {

secret = await this._secretForKey(apiKey);

} catch (error) {
} catch (error: any) {

if (error === undefined) {

Expand Down

0 comments on commit b9cd361

Please sign in to comment.