Description
In packages/query/src/query-handler.ts, the lookupByUAL method catches all errors and returns a success response (OK) with empty data, effectively masking database failures and other internal errors.
Impact
- High severity — If the Oxigraph storage is down or a query fails, the caller receives a "success" response with no data instead of an error. This makes it impossible to distinguish between "no data exists" and "the database is broken".
- Debugging production issues becomes extremely difficult because errors are silently swallowed.
- Clients may incorrectly assume a UAL doesn't exist when the underlying storage is actually failing.
Code Pattern
The problematic pattern (approximate):
async lookupByUAL(ual: string) {
try {
// ... query storage ...
return { status: 'OK', data: results };
} catch (err) {
// BUG: Returns success with empty data instead of propagating the error
return { status: 'OK', data: [] };
}
}
Suggested Fix
The catch block should return an error status:
catch (err) {
log.error('lookupByUAL failed:', err);
return { status: 'ERROR', error: err.message };
}
Location
packages/query/src/query-handler.ts — lookupByUAL method.
Description
In
packages/query/src/query-handler.ts, thelookupByUALmethod catches all errors and returns a success response (OK) with empty data, effectively masking database failures and other internal errors.Impact
Code Pattern
The problematic pattern (approximate):
Suggested Fix
The catch block should return an error status:
Location
packages/query/src/query-handler.ts—lookupByUALmethod.