Skip to content

Commit

Permalink
refactor: format
Browse files Browse the repository at this point in the history
  • Loading branch information
9renpoto committed Aug 5, 2020
1 parent 30a9625 commit e994864
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/raven.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ import {
HttpArgumentsHost,
} from '@nestjs/common/interfaces';
import { Handlers } from '@sentry/node';
import type {
GraphQLArgumentsHost,
GqlContextType,
} from '@nestjs/graphql';
import type { GraphQLArgumentsHost, GqlContextType } from '@nestjs/graphql';

let GqlArgumentsHost: any;
try {
({ GqlArgumentsHost } = require('@nestjs/graphql'))
} catch(e) {}
({ GqlArgumentsHost } = require('@nestjs/graphql'));
} catch (e) {}

@Injectable()
export class RavenInterceptor implements NestInterceptor {
Expand Down Expand Up @@ -55,7 +52,8 @@ export class RavenInterceptor implements NestInterceptor {
exception,
);
case 'graphql':
if (!GqlArgumentsHost) return this.captureException(scope, exception);
if (!GqlArgumentsHost)
return this.captureException(scope, exception);
return this.captureGraphQLException(
scope,
GqlArgumentsHost.create(context),
Expand Down

0 comments on commit e994864

Please sign in to comment.