Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit dd700ee

Browse files
committed
fix: πŸ› replace default error by polymatherror
1 parent fa729a6 commit dd700ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

β€Žsrc/contract_wrappers/modules/module_wrapper.tsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '@polymathnetwork/abi-wrappers';
1010
import ContractWrapper from '../contract_wrapper';
1111
import ContractFactory from '../../factories/contractFactory';
12+
import { PolymathError } from '../../PolymathError';
1213
import { TxParams, GenericModuleContract, GetLogs, Subscribe, ErrorCode } from '../../types';
1314
import { stringToBytes32, parseModuleTypeValue } from '../../utils/convert';
1415
import functionsUtils from '../../utils/functions_utils';
@@ -120,7 +121,7 @@ export default class ModuleWrapper extends ContractWrapper {
120121
});
121122
// prevent invalid scenarios
122123
if (!types.length || types.length > 1) {
123-
return false;
124+
throw new PolymathError({ code: ErrorCode.InvalidData });
124125
}
125126
const address = await this.address();
126127
const result = await (await this.securityTokenContract()).isModule.callAsync(address, types[0]);

β€Žsrc/factories/moduleWrapperFactory.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,6 @@ export default class ModuleWrapperFactory {
222222
}
223223

224224
// TODO: Typed error here
225-
throw new Error('Invalid module');
225+
throw new PolymathError({ code: ErrorCode.InvalidData, message: 'Invalid module' });
226226
};
227227
}

0 commit comments

Comments
Β (0)