Slide 2
Slide 2 text
Exceptions!
exceptionalMethod(userId, data) {
try {
let isOwner
try {
isOwner = this.authservice.isOwnerOf(userId, data.id)
} catch (e) {
this.logger.error('got http exception while invoking authService')
}
if (isOwner) {
this.dao.update(data.id, data)
}
} catch (daoException) {
this.logger.error('exception caught')
}
}
nonExceptionalMethod(userId, data) {
let isOwner = this.authservice.isOwnerOf(userId, data.id)
if (isOwner) {
this.dao.update(data.id, data)
}
}