diff --git a/packages/nocodb/src/helpers/PagedResponse.ts b/packages/nocodb/src/helpers/PagedResponse.ts index 72b3714d46..c1e606a1d2 100644 --- a/packages/nocodb/src/helpers/PagedResponse.ts +++ b/packages/nocodb/src/helpers/PagedResponse.ts @@ -1,5 +1,6 @@ import { extractLimitAndOffset } from '.'; import type { PaginatedType } from 'nocodb-sdk'; +import {NcError} from "~/helpers/catchError"; export class PagedResponseImpl { constructor( @@ -40,11 +41,7 @@ export class PagedResponseImpl { if (additionalProps) Object.assign(this, additionalProps); if (offset && offset >= +count) { - this.errors = [ - { - message: 'Offset is beyond the total number of records', - }, - ]; + NcError.badRequest('Offset is beyond the total number of records'); } }