You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewError("Connection strings are not supported in core directly. Use @objectql/platform-node's createDriverFromConnection or pass a driver instance to 'datasources'.");
72
+
thrownewObjectQLError({code: 'CONFIG_ERROR',message: "Connection strings are not supported in core directly. Use @objectql/platform-node's createDriverFromConnection or pass a driver instance to 'datasources'."});
72
73
}
73
74
74
75
// Use the imported RuntimeObjectQL, assuming it works as intended
@@ -82,7 +83,7 @@ export class ObjectQL implements IObjectQL {
82
83
if(config.plugins){
83
84
for(constpluginofconfig.plugins){
84
85
if(typeofplugin==='string'){
85
-
thrownewError("String plugins are not supported in core. Use @objectql/platform-node or pass plugin instance.");
86
+
thrownewObjectQLError({code: 'CONFIG_ERROR',message: "String plugins are not supported in core. Use @objectql/platform-node or pass plugin instance."});
86
87
}else{
87
88
this.use(pluginasany);
88
89
}
@@ -203,7 +204,7 @@ export class ObjectQL implements IObjectQL {
203
204
if(handler){
204
205
returnhandler(ctx);
205
206
}
206
-
thrownewError(`Action '${actionName}' on object '${objectName}' not found`);
207
+
thrownewObjectQLError({code: 'NOT_FOUND',message: `Action '${actionName}' on object '${objectName}' not found`});
207
208
}
208
209
};
209
210
@@ -325,7 +326,7 @@ export class ObjectQL implements IObjectQL {
325
326
*/
326
327
getKernel(): ObjectKernel{
327
328
if(!this.kernel){
328
-
thrownewError('Kernel not initialized. Call init() first.');
329
+
thrownewObjectQLError({code: 'INTERNAL_ERROR',message: 'Kernel not initialized. Call init() first.'});
329
330
}
330
331
returnthis.kernel;
331
332
}
@@ -366,7 +367,7 @@ export class ObjectQL implements IObjectQL {
366
367
datasource(name: string): Driver{
367
368
constdriver=this.datasources[name];
368
369
if(!driver){
369
-
thrownewError(`Datasource '${name}' not found`);
370
+
thrownewObjectQLError({code: 'NOT_FOUND',message: `Datasource '${name}' not found`});
370
371
}
371
372
returndriver;
372
373
}
@@ -390,7 +391,7 @@ export class ObjectQL implements IObjectQL {
390
391
constdriver=this.datasource(datasourceName);
391
392
392
393
if(!driver.introspectSchema){
393
-
thrownewError(`Driver for datasource '${datasourceName}' does not support schema introspection`);
394
+
thrownewObjectQLError({code: 'DRIVER_UNSUPPORTED_OPERATION',message: `Driver for datasource '${datasourceName}' does not support schema introspection`});
thrownewError(`Driver does not support aggregate operations. Consider using a driver that supports aggregation.`);
337
+
thrownewObjectQLError({code: 'DRIVER_UNSUPPORTED_OPERATION',message: `Driver does not support aggregate operations. Consider using a driver that supports aggregation.`});
0 commit comments