We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33ebade commit a0a3397Copy full SHA for a0a3397
packages/context/src/context.ts
@@ -223,23 +223,19 @@ export class Context {
223
): Promise<T | undefined>;
224
225
// Implementation
226
- get<T>(
+ async get<T>(
227
keyWithPath: string,
228
optionsOrSession?: ResolutionOptions | ResolutionSession,
229
): Promise<T | undefined> {
230
/* istanbul ignore if */
231
if (debug.enabled) {
232
debug('Resolving binding: %s', keyWithPath);
233
}
234
- try {
235
- const valueOrPromiseLike = this.getValueOrPromise<T>(
236
- keyWithPath,
237
- optionsOrSession,
238
- );
239
- return Promise.resolve<T | undefined>(valueOrPromiseLike);
240
- } catch (err) {
241
- return Promise.reject(err);
242
- }
+
+ return await this.getValueOrPromise<T | undefined>(
+ keyWithPath,
+ optionsOrSession,
+ );
243
244
245
/**
0 commit comments