File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { type TFunction } from 'i18next'
22
33export default class IpldExploreError extends Error {
4+ // translation key to prevent minification issues
5+ readonly translationKey : string
6+
47 constructor ( private readonly options : Record < string , string | number > ) {
58 super ( )
6- this . name = this . constructor . name
9+ this . translationKey ?? = this . constructor . name
710 }
811
912 /**
@@ -17,8 +20,18 @@ export default class IpldExploreError extends Error {
1720 * t('NameOfErrorClassThatExtendsIpldExploreError')
1821 */
1922 toString ( t : TFunction < 'translation' , 'translation' > ) : string {
20- return t ( this . name , this . options )
23+ return t ( this . translationKey , this . options )
2124 }
2225}
2326
24- export class BlockFetchTimeoutError extends IpldExploreError { }
27+ export class BlockFetchTimeoutError extends IpldExploreError {
28+ readonly translationKey = 'BlockFetchTimeoutError'
29+ }
30+
31+ export class BlockFetchError extends IpldExploreError {
32+ readonly translationKey = 'BlockFetchError'
33+ }
34+
35+ export class CidSyntaxError extends IpldExploreError {
36+ readonly translationKey = 'CidSyntaxError'
37+ }
You can’t perform that action at this time.
0 commit comments