Skip to content

Commit 7217a20

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

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

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

55
/**
66
* Scope of an {@link QuotasExceededErrorDetails} error.
77
*
88
* @public
99
*/
10-
export type QuotasExceededErrorScope = {
10+
export interface QuotasExceededErrorScope {
1111
kind: 'organization' | 'project'
1212
id: string
1313
}
@@ -17,7 +17,7 @@ export type QuotasExceededErrorScope = {
1717
*
1818
* @public
1919
*/
20-
export type QuotasExceededErrorDetails = {
20+
export interface QuotasExceededErrorDetails {
2121
readonly resource: string
2222
readonly quota: number
2323
readonly current: number
@@ -35,7 +35,7 @@ export type QuotasExceededErrorDetails = {
3535
const buildMessage = (list: QuotasExceededErrorDetails[]): string =>
3636
`quota(s) exceeded: ${list
3737
.map(details => {
38-
const message = `${details.resource} has reached its quota (${details.current}/${details.quota})`
38+
const message = `Quotas reached: You have reached the maximum number of ${details.resource} authorized by your Organization. Access the quotas page from your Organization dashboard to manage quotas.`
3939
4040
return details.scope
4141
? `${message} for ${details.scope.kind} '${details.scope.id}'`

0 commit comments

Comments
 (0)