code: public static CStorageException buildCStorageException( CResponse response, String message, CPath path )
      {
          switch ( response.getStatus() ) {
              case 401:
                  return new CAuthenticationException( message, response );
  
              case 404:
                  message = "No file found at URL " + shortenUrl( response.getUri() ) + " (" + message + ")";
                  return new CFileNotFoundException( message, path );
  
              default:
                  return new CHttpException( message, response );
          }
      }
docs: Some common code between providers. Handles the different status codes, and generates a nice exception
  
  @param response The wrapped HTTP response
  @param message The error message (provided by the server or by the application)
  @param path The file requested (which failed)
  @return The exception