Skip to content

Commit e5aea64

Browse files
fix(api/search): make filter errors more specific
1 parent 5c9df64 commit e5aea64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/api/search.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ export async function list<T, H = T>(
102102
} catch (e) {
103103
let m = `Error filtering ${indexId}`;
104104
if (e instanceof Error) m = `${e.name} filtering ${indexId}: ${e.message}`;
105-
if (typeof e === 'string') m = `Error filtering ${indexId}: ${e}`;
105+
if (typeof e?.message === 'string') m += `: ${e.message}`;
106+
if (typeof e === 'string') m += `: ${e}`;
106107
throw new APIError(m, 500);
107108
}
108109
}

0 commit comments

Comments
 (0)