Download libraries/nestjs-libraries/src/integrations/integration.missing.scopes.ts from Leon4gr45/postio: direct link, hf CLI and curl.
- Browser
- Download file 573 Bytes
-
https://huggingface.co/spaces/Leon4gr45/postio/resolve/main/libraries/nestjs-libraries/src/integrations/integration.missing.scopes.ts
- Command line
-
hf download hf://spaces/Leon4gr45/postio/libraries/nestjs-libraries/src/integrations/integration.missing.scopes.ts
-
curl -L -o integration.missing.scopes.ts https://huggingface.co/spaces/Leon4gr45/postio/resolve/main/libraries/nestjs-libraries/src/integrations/integration.missing.scopes.ts
573 Bytes
| import { ExceptionFilter, Catch, ArgumentsHost } from '@nestjs/common'; | |
| import { Response } from 'express'; | |
| import { NotEnoughScopes } from '@gitroom/nestjs-libraries/integrations/social.abstract'; | |
| import { HttpStatusCode } from 'axios'; | |
| (NotEnoughScopes) | |
| export class NotEnoughScopesFilter implements ExceptionFilter { | |
| catch(exception: NotEnoughScopes, host: ArgumentsHost) { | |
| const ctx = host.switchToHttp(); | |
| const response = ctx.getResponse<Response>(); | |
| response | |
| .status(HttpStatusCode.Conflict) | |
| .json({ msg: exception.message }); | |
| } | |
| } | |