handle errors thrown by getauthorizationheader api