Currently in ErrorHandler.php you only show the error message. This is bad because B2 unhelpfully very often leaves this field blank.
Include the error code too:
throw new $exceptionClass('Received error from B2: '.$responseJson['message'].' Code: '.$responseJson['code']);