Upper level throw error in asynchronous function
it
async create(body: NewDevice, firstTry = true): Promise<RepresentationalDevice> { try { return await this.dataAccess.getAccessToken() } catch (error) { throw error } }
VS it
async create(body: NewDevice, firstTry = true): Promise<RepresentationalDevice> { return await this.dataAccess.getAccessToken() }
I mean, at the end, at the top level, I should still catch the error and there will be no change in catch at all
Are these two approaches the same? Can I use the second approach without error handling problems?
source share