| 194 | /** Error thrown when cursor-based pagination encounters missing or invalid cursor values. */ |
| 195 | export class CursorError<T extends AnyEntity = AnyEntity> extends ValidationError<T> { |
| 196 | static entityNotPopulated(entity: AnyEntity, prop: string): ValidationError { |
| 197 | return new CursorError(`Cannot create cursor, value for '${entity.constructor.name}.${prop}' is missing.`); |
| 198 | } |
| 199 | |
| 200 | static missingValue(entityName: string, prop: string): ValidationError { |
| 201 | return new CursorError(`Invalid cursor condition, value for '${entityName}.${prop}' is missing.`); |