@trading-boy/cli 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,7 +112,14 @@ export async function apiRequest(path, options = {}) {
112
112
  throw new ApiError('API key invalid or expired. Run `trading-boy login` to re-authenticate.', 401);
113
113
  }
114
114
  if (response.status === 403) {
115
- throw new ApiError('Subscription inactive. Run `trading-boy billing manage` to update your billing.', 403);
115
+ let message = 'Subscription inactive. Run `trading-boy billing manage` to update your billing.';
116
+ try {
117
+ const body = await response.clone().json();
118
+ if (typeof body.error === 'string')
119
+ message = body.error;
120
+ }
121
+ catch { /* use default message */ }
122
+ throw new ApiError(message, 403);
116
123
  }
117
124
  if (response.status === 429) {
118
125
  const retryAfter = response.headers.get('Retry-After');