mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-16 17:25:58 +00:00
Refactor text messages (#1312)
This commit is contained in:
parent
759a4ca5cf
commit
c2673ec707
@ -571,4 +571,5 @@ export enum PhoenixErrorType {
|
|||||||
SubscriptionNotAllowed = "SubscriptionNotAllowed",
|
SubscriptionNotAllowed = "SubscriptionNotAllowed",
|
||||||
UnknownError = "UnknownError",
|
UnknownError = "UnknownError",
|
||||||
PhoenixFlightFallback = "PhoenixFlightFallback",
|
PhoenixFlightFallback = "PhoenixFlightFallback",
|
||||||
|
UserMissingPermissionsError = "UserMissingPermissionsError",
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,6 @@ import {
|
|||||||
IContainerData,
|
IContainerData,
|
||||||
IDbAccountAllow,
|
IDbAccountAllow,
|
||||||
IMaxAllocationTimeExceeded,
|
IMaxAllocationTimeExceeded,
|
||||||
IMaxDbAccountsPerUserExceeded,
|
|
||||||
IMaxUsersPerDbAccountExceeded,
|
|
||||||
IPhoenixConnectionInfoResult,
|
IPhoenixConnectionInfoResult,
|
||||||
IPhoenixError,
|
IPhoenixError,
|
||||||
IProvisionData,
|
IProvisionData,
|
||||||
@ -240,34 +238,13 @@ export class PhoenixClient {
|
|||||||
const maxAllocationTimeExceeded = errInfo as IMaxAllocationTimeExceeded;
|
const maxAllocationTimeExceeded = errInfo as IMaxAllocationTimeExceeded;
|
||||||
const allocateAfterTimestamp = new Date(maxAllocationTimeExceeded?.earliestAllocationTimestamp);
|
const allocateAfterTimestamp = new Date(maxAllocationTimeExceeded?.earliestAllocationTimestamp);
|
||||||
allocateAfterTimestamp.setDate(allocateAfterTimestamp.getDate() + 1);
|
allocateAfterTimestamp.setDate(allocateAfterTimestamp.getDate() + 1);
|
||||||
return (
|
return `${errInfo.message}` + ". Please try again after " + `${allocateAfterTimestamp.toLocaleString()}`;
|
||||||
`${errInfo.message}` +
|
|
||||||
" Max allocation time for a day to a user is " +
|
|
||||||
`${maxAllocationTimeExceeded.maxAllocationTimePerDayPerUserInMinutes}` +
|
|
||||||
". Please try again after " +
|
|
||||||
`${allocateAfterTimestamp.toLocaleString()}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
case PhoenixErrorType.MaxDbAccountsPerUserExceeded: {
|
|
||||||
const maxDbAccountsPerUserExceeded = errInfo as IMaxDbAccountsPerUserExceeded;
|
|
||||||
return (
|
|
||||||
`${errInfo.message}` +
|
|
||||||
" Max simultaneous connections allowed per user is " +
|
|
||||||
`${maxDbAccountsPerUserExceeded.maxSimultaneousConnectionsPerUser}` +
|
|
||||||
"."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
case PhoenixErrorType.MaxUsersPerDbAccountExceeded: {
|
|
||||||
const maxUsersPerDbAccountExceeded = errInfo as IMaxUsersPerDbAccountExceeded;
|
|
||||||
return (
|
|
||||||
`${errInfo.message}` +
|
|
||||||
" Max simultaneous users allowed per DbAccount is " +
|
|
||||||
`${maxUsersPerDbAccountExceeded.maxSimultaneousUsersPerDbAccount}` +
|
|
||||||
"."
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
case PhoenixErrorType.MaxDbAccountsPerUserExceeded:
|
||||||
|
case PhoenixErrorType.MaxUsersPerDbAccountExceeded:
|
||||||
case PhoenixErrorType.AllocationValidationResult:
|
case PhoenixErrorType.AllocationValidationResult:
|
||||||
case PhoenixErrorType.RegionNotServicable:
|
case PhoenixErrorType.RegionNotServicable:
|
||||||
|
case PhoenixErrorType.UserMissingPermissionsError:
|
||||||
case PhoenixErrorType.SubscriptionNotAllowed: {
|
case PhoenixErrorType.SubscriptionNotAllowed: {
|
||||||
return `${errInfo.message}`;
|
return `${errInfo.message}`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user