@@ -13,8 +13,8 @@ import {
1313import { WorkerGroupService } from "~/v3/services/worker/workerGroupService.server" ;
1414import type { RunEngine } from "~/v3/runEngine.server" ;
1515import { env } from "~/env.server" ;
16- import { EngineServiceValidationError } from "./errors" ;
1716import { tryCatch } from "@trigger.dev/core/v3" ;
17+ import { ServiceValidationError } from "~/v3/services/common.server" ;
1818
1919export class DefaultQueueManager implements QueueManager {
2020 constructor (
@@ -45,7 +45,7 @@ export class DefaultQueueManager implements QueueManager {
4545 } ) ;
4646
4747 if ( ! specifiedQueue ) {
48- throw new EngineServiceValidationError (
48+ throw new ServiceValidationError (
4949 `Specified queue '${ specifiedQueueName } ' not found or not associated with locked version '${
5050 lockedBackgroundWorker . version ?? "<unknown>"
5151 } '.`
@@ -68,7 +68,7 @@ export class DefaultQueueManager implements QueueManager {
6868 } ) ;
6969
7070 if ( ! lockedTask ) {
71- throw new EngineServiceValidationError (
71+ throw new ServiceValidationError (
7272 `Task '${ request . taskId } ' not found on locked version '${
7373 lockedBackgroundWorker . version ?? "<unknown>"
7474 } '.`
@@ -83,7 +83,7 @@ export class DefaultQueueManager implements QueueManager {
8383 workerId : lockedBackgroundWorker . id ,
8484 version : lockedBackgroundWorker . version ,
8585 } ) ;
86- throw new EngineServiceValidationError (
86+ throw new ServiceValidationError (
8787 `Default queue configuration for task '${ request . taskId } ' missing on locked version '${
8888 lockedBackgroundWorker . version ?? "<unknown>"
8989 } '.`
@@ -97,7 +97,7 @@ export class DefaultQueueManager implements QueueManager {
9797 // Task is not locked to a specific version, use regular logic
9898 if ( request . body . options ?. lockToVersion ) {
9999 // This should only happen if the findFirst failed, indicating the version doesn't exist
100- throw new EngineServiceValidationError (
100+ throw new ServiceValidationError (
101101 `Task locked to version '${ request . body . options . lockToVersion } ', but no worker found with that version.`
102102 ) ;
103103 }
@@ -221,11 +221,11 @@ export class DefaultQueueManager implements QueueManager {
221221 ) ;
222222
223223 if ( error ) {
224- throw new EngineServiceValidationError ( error . message ) ;
224+ throw new ServiceValidationError ( error . message ) ;
225225 }
226226
227227 if ( ! workerGroup ) {
228- throw new EngineServiceValidationError ( "No worker group found" ) ;
228+ throw new ServiceValidationError ( "No worker group found" ) ;
229229 }
230230
231231 return workerGroup . masterQueue ;
0 commit comments