Skip to content

Commit

Permalink
Better error handling for undefined service identifier
Browse files Browse the repository at this point in the history
Signed-off-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
  • Loading branch information
ardatan committed Jan 16, 2019
1 parent a05bea3 commit 9c62939
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/di/src/utils.ts
Expand Up @@ -6,8 +6,10 @@ export const PROVIDER_OPTIONS = 'provider-options';
export function getServiceIdentifierName<T>(serviceIdentifier: ServiceIdentifier<T>) {
if (typeof serviceIdentifier === 'function' && isType<T>(serviceIdentifier)) {
return serviceIdentifier.name;
} else {
} else if (typeof serviceIdentifier !== 'undefined') {
return serviceIdentifier.toString();
} else {
return 'undefined';
}
}

Expand Down

0 comments on commit 9c62939

Please sign in to comment.