From 3e80bc8a4d3127d17dbc3f52301d33a79e53a980 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 6 Apr 2024 21:36:42 +0200 Subject: [node] multiple contracting fixes and some more refactoring --- nodejs/lib/contracts.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nodejs/lib/contracts.ts') diff --git a/nodejs/lib/contracts.ts b/nodejs/lib/contracts.ts index 833d434..0582cc7 100644 --- a/nodejs/lib/contracts.ts +++ b/nodejs/lib/contracts.ts @@ -61,6 +61,10 @@ export async function deliver(contract: Contract, ship: Ship): Promise }}); if (response.error) { switch(response.error.code) { + case 4503: // contract has expired + // TODO sell cargo? the next trading loop should take care of it by itself + contract.fulfilled = true; + return contract; case 4509: // contract delivery terms have been met return await fulfill(contract); default: // yet unhandled error -- cgit v1.2.3