Skip to content

Commit

Permalink
removed unnessesary try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
nikiwycherley committed Oct 11, 2023
1 parent 1c17bac commit 6ba85ce
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/functions/processMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,7 @@ module.exports.processMessage = async (event) => {
})
})

let dbResult

try {
dbResult = await service.getLastMessage(xmlResult.alert.info[0].area[0].geocode[0].value[0])
} catch (error) {
console.error('Error while getting last message:', error)
throw error
}
const dbResult = await service.getLastMessage(xmlResult.alert.info[0].area[0].geocode[0].value[0])

const lastMessage = (!!dbResult && dbResult.rows.length > 0) ? dbResult.rows[0] : undefined

Expand Down

0 comments on commit 6ba85ce

Please sign in to comment.