| 1 |
import { createErrorClass } from './createErrorClass'; |
| 2 |
|
| 3 |
export interface EmptyError extends Error {} |
| 4 |
|
| 5 |
export interface EmptyErrorCtor { |
| 6 |
/** |
| 7 |
* @deprecated Internal implementation detail. Do not construct error instances. |
| 8 |
* Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 |
| 9 |
*/ |
| 10 |
new (): EmptyError; |
| 11 |
} |
| 12 |
|
| 13 |
/** |
| 14 |
* An error thrown when an Observable or a sequence was queried but has no |
| 15 |
* elements. |
| 16 |
* |
| 17 |
* @see {@link first} |
| 18 |
* @see {@link last} |
| 19 |
* @see {@link single} |
| 20 |
* @see {@link firstValueFrom} |
| 21 |
* @see {@link lastValueFrom} |
| 22 |
*/ |
| 23 |
export const EmptyError: EmptyErrorCtor = createErrorClass( |
| 24 |
(_super) => |
| 25 |
function EmptyErrorImpl(this: any) { |
| 26 |
_super(this); |
| 27 |
this.name = 'EmptyError'; |
| 28 |
this.message = 'no elements in sequence'; |
| 29 |
} |
| 30 |
); |