Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit 9b90e96

Browse files
authored
Merge pull request #25 from open-AIMS/improvements
2 parents c4c324a + 08a3c23 commit 9b90e96

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/api/services/jobs.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ const sharedCriteriaSchema = z.object({
4040
reef_type: z.string().describe('The type of reef, slopes or flats'),
4141

4242
// Criteria - all optional to match the Union{Float64,Nothing} in worker
43-
depth_min: z.number().optional().describe('The depth range (min)'),
44-
depth_max: z.number().optional().describe('The depth range (max)'),
43+
depth_min: z
44+
.number()
45+
.optional()
46+
.describe('The depth minimum (the deeper more negative value)'),
47+
depth_max: z
48+
.number()
49+
.optional()
50+
.describe('The depth maximum (the shallower less negative value)'),
4551
slope_min: z.number().optional().describe('The slope range (min)'),
4652
slope_max: z.number().optional().describe('The slope range (max)'),
4753
rugosity_min: z.number().optional().describe('The rugosity range (min)'),
@@ -167,7 +173,11 @@ export class JobService {
167173
try {
168174
return schema.parse(payload);
169175
} catch (e) {
170-
throw new BadRequestException(`Invalid payload for job type ${jobType}`);
176+
const cause = e instanceof Error ? e : undefined;
177+
throw new BadRequestException(
178+
`Invalid payload for job type ${jobType}`,
179+
cause,
180+
);
171181
}
172182
}
173183

0 commit comments

Comments
 (0)