We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98a52de commit d09cc59Copy full SHA for d09cc59
api/subscription.ts
@@ -13,6 +13,7 @@ import {
13
import { TaskResponse } from '../types/task';
14
import { Task } from '../api/task';
15
import { Client } from './api.base';
16
+import { AxiosError } from 'axios';
17
18
export class Subscription {
19
private task: Task
@@ -58,7 +59,10 @@ export class Subscription {
58
59
const response = await this.client.get(`/subscriptions/${subscriptionId}`);
60
return response.data;
61
}
- catch(error) {
62
+ catch(error: any | AxiosError) {
63
+ if (error.name === 'AxiosError' && error.response.status === 404) {
64
+ return error.response as SubscriptionResponse;
65
+ }
66
return error as any;
67
68
0 commit comments