Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: exception handling for multi-tenancy controller #142

Merged
6 changes: 6 additions & 0 deletions src/controllers/did/DidController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,13 @@ export class DidController extends Controller {
public async handlePolygon(createDidOptions: DidCreate) {
// need to discuss try catch logic
const { endpoint, network, privatekey } = createDidOptions

if (!network) {
throw new BadRequestError('Network is required for Polygon method')
}

const networkName = network?.split(':')[1]

if (networkName !== 'mainnet' && networkName !== 'testnet') {
throw new BadRequestError('Invalid network type')
}
Expand Down
Loading