How to use the @marblejs/core.HttpStatus.PRECONDITION_FAILED function in @marblejs/core

To help you get started, we’ve selected a few @marblejs/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marblejs / marble / packages / middleware-multipart / src / multipart.parser.file.ts View on Github external
const fileSizeLimit = (maxBytes: number | undefined) => (data: FileIncomingData) => (finish$: Observable) =>
  fromEvent(data.file, 'limit').pipe(
    takeUntil(finish$),
    mergeMapTo(throwError(
      new HttpError(`Reached file size limit for "${data.fieldname}" [${maxBytes} bytes]`, HttpStatus.PRECONDITION_FAILED),
    )),
    ignoreElements(),
  );
github marblejs / marble / packages / middleware-multipart / src / multipart.parser.ts View on Github external
mergeMap(() => throwError(
      new HttpError(`Reached max fields count limit [${opts.maxFieldCount}]`, HttpStatus.PRECONDITION_FAILED),
    )),
  );
github marblejs / marble / packages / middleware-multipart / src / multipart.parser.ts View on Github external
mergeMap(() => throwError(
      new HttpError(`Reached max files count limit [${opts.maxFileCount}]`, HttpStatus.PRECONDITION_FAILED),
    )),
  );
github marblejs / marble / packages / middleware-multipart / src / multipart.middleware.ts View on Github external
mergeMap(req => shouldParseMultipart(req)
      ? parseMultipart(opts)(req)
      : throwError(
        new HttpError(`Content-Type must be of type ${ContentType.MULTIPART_FORM_DATA}`, HttpStatus.PRECONDITION_FAILED)
      )),
    map(req => req as T & WithFile),