-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted hex errors to readable errors
- Loading branch information
1 parent
b469896
commit c45e8a7
Showing
15 changed files
with
71 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
client/src/components/Panels/Side/Right/Settings/NetworkSetting.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export enum ItemError { | ||
ALREADY_EXISTS = "Already exists", | ||
INVALID_NAME = "Invalid name", | ||
} | ||
|
||
interface ProgramError { | ||
[key: string]: string; | ||
} | ||
|
||
export const PROGRAM_ERROR: ProgramError = { | ||
"0": "Lamport balance below rent-exempt threshold", | ||
"1": "Insufficient funds", | ||
"2": "Invalid Mint(token address)", | ||
"3": "Account not associated with this Mint(token address)", | ||
"4": "Owner does not match", | ||
"5": "This token's supply is fixed and new tokens cannot be minted.", | ||
"6": "The account cannot be initialized because it is already being used.", | ||
"7": "Invalid number of provided signers", | ||
"8": "Invalid number of required signers", | ||
"9": "State is unititialized", | ||
a: "Instruction does not support native tokens", | ||
b: "Non-native account can only be closed if its balance is zero", | ||
c: "Invalid instruction", | ||
d: "State is invalid for requested operation.", | ||
e: "Operation overflowed", | ||
f: "Account does not support specified authority type", | ||
"10": "This token mint cannot freeze accounts", | ||
"11": "Account is frozen, all account operations will fail", | ||
"12": "The provided decimals value different from the Mint decimals", | ||
"13": "Instruction does not support non-native tokens", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from "./connection"; | ||
export * from "./html-class"; | ||
export * from "./project"; | ||
export * from "./img"; | ||
export * from "./errors"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { PROGRAM_ERROR } from "../../constants"; | ||
|
||
export class PgError { | ||
static convertErrorMessage(msg: string) { | ||
for (const programErrorCode in PROGRAM_ERROR) { | ||
if (msg.endsWith(programErrorCode)) { | ||
msg = msg.replace( | ||
`custom program error: 0x${programErrorCode}`, | ||
PROGRAM_ERROR[programErrorCode] | ||
); | ||
break; | ||
} | ||
} | ||
|
||
return msg; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters