summaryrefslogtreecommitdiff
path: root/nodejs/lib/errors.ts
blob: c560ee83600145fdd4e2148026761ea1cffb3ba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Cooldown } from './types.ts';

export type ContractDeadlineExpired = {
	contractId: string;
	deadline: Date;
};

export type MarketTradeVolumeError = {
	waypointSymbol: string;
	tradeSymbol: string;
	units: number;
	tradeVolume: number;
};

export type RateLimitError = {
	type: string;
	retryAfter: number;
	limitBurst: number;
	limitPerSecond: number;
	remaining: number;
	reset: Date;
};

export type ShipIsCurrentlyInTransitError = {
	arrival: Date;
	departureSymbol: string;
	departureTime: Date;
	destinationSymbol: string;
	secondsToArrival: number;
};

export type ShipIsStillOnCooldownError = {
	cooldown: Cooldown;
};

export type ShipRequiresMoreFuelForNavigationError = {
	fuelAvailable: number;
	fuelRequired: number;
	shipSymbol: string;
};