Make table creation error handling more robust
This commit is contained in:
parent
9627d912b4
commit
7964435ed7
@ -171,7 +171,7 @@ export const getPhotos = async (
|
|||||||
try {
|
try {
|
||||||
photos = await getPhotosRequest(limit, offset);
|
photos = await getPhotosRequest(limit, offset);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
if (e.message === 'relation "photos" does not exist') {
|
if (/relation "photos" does not exist/i.test(e.message)) {
|
||||||
console.log(
|
console.log(
|
||||||
'Creating table "photos" because it did not exist',
|
'Creating table "photos" because it did not exist',
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user