Skip to content

Commit 8b9e375

Browse files
committed
feat: update QuotasExceededError message with clearer instructions
1 parent 7217a20 commit 8b9e375

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/clients/src/scw/errors/non-standard/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('InvalidRequestError', () => {
5050
},
5151
])
5252
expect(error.message).toBe(
53-
'quota(s) exceeded: compute_snapshots_type_b_ssd_available has reached its quota (0/0)',
53+
'quota(s) exceeded: Quotas reached: You have reached the maximum number of compute_snapshots_type_b_ssd_available authorized by your Organization. Access the quotas page from your Organization dashboard to manage quotas.',
5454
)
5555
})
5656

packages/clients/src/scw/errors/standard/__tests__/index.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line import/no-extraneous-dependencies
21
import { describe, expect, it } from 'vitest'
32
import type { JSONObject } from '../../../../helpers/json'
43
import { parseScalewayError } from '../../error-parser'
@@ -95,7 +94,7 @@ describe('QuotasExceededError', () => {
9594

9695
it(`parses a valid input`, () => {
9796
expect(parseScalewayError(403, body).toString()).toBe(
98-
`QuotasExceededError: quota(s) exceeded: instance_volume has reached its quota (10/10) for project 'b7a1cf21-1e90-464c-a9f6-375c4d1f4b64'; instance_volumes_l_ssd_total_gb has reached its quota (80/100) for organization '72dd6741-d748-42e7-ba65-acd07447d3e9'; instance_volumes_l_ssd_total_gb has reached its quota (70/100)`,
97+
'quota(s) exceeded: Quotas reached: You have reached the maximum number of compute_snapshots_type_b_ssd_available authorized by your Organization. Access the quotas page from your Organization dashboard to manage quotas.',
9998
)
10099
})
101100

packages/clients/src/scw/errors/standard/quotas-exceeded-error.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { JSONObject } from '../../../helpers/json.js'
2-
import { isJSONObject } from '../../../helpers/json.js'
3-
import { ScalewayError } from '../scw-error.js'
1+
import type { JSONObject } from '../../../helpers/json'
2+
import { isJSONObject } from '../../../helpers/json'
3+
import { ScalewayError } from '../scw-error'
44

55
/**
66
* Scope of an {@link QuotasExceededErrorDetails} error.

0 commit comments

Comments
 (0)