Skip to content

Commit

Permalink
fix: handle jwt error in createObject
Browse files Browse the repository at this point in the history
  • Loading branch information
inian committed Mar 18, 2021
1 parent 0ed30a6 commit cdddae0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/routes/object/createObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@ export default async function routes(fastify: FastifyInstance) {
const objectName = request.params['*']

const postgrest = getPostgrestClient(jwt)
const owner = await getOwner(jwt)
let owner
try {
owner = await getOwner(jwt)
} catch (err) {
console.log(err)
return response.status(400).send({
statusCode: '400',
error: err.message,
message: err.message,
})
}
// @todo how to merge these into one query?
// i can create a view and add INSTEAD OF triggers..is that the way to do it?
const bucketResponse = await postgrest
Expand Down

0 comments on commit cdddae0

Please sign in to comment.