All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cpprest.apiexception-header.mustache Maven / Gradle / Ivy

There is a newer version: 3.0.0-rc1
Show newest version
{{>licenseInfo}}
/*
 * ApiException.h
 *
 * This is the exception being thrown in case the api call was not successful
 */

#ifndef {{apiHeaderGuardPrefix}}_ApiException_H_
#define {{apiHeaderGuardPrefix}}_ApiException_H_

{{{defaultInclude}}}

#include 
#include 

#include 
#include 


{{#apiNamespaceDeclarations}}
namespace {{this}} {
{{/apiNamespaceDeclarations}}

class {{declspec}} ApiException
    : public web::http::http_exception
{
public:
    ApiException( int errorCode
        , const utility::string_t& message
        , std::shared_ptr content = nullptr );
    ApiException( int errorCode
        , const utility::string_t& message
        , std::map& headers
        , std::shared_ptr content = nullptr );
    virtual ~ApiException();

    std::map& getHeaders();
    std::shared_ptr getContent() const;

protected:
    std::shared_ptr m_Content;
    std::map m_Headers;
};

{{#apiNamespaceDeclarations}}
}
{{/apiNamespaceDeclarations}}

#endif /* {{apiHeaderGuardPrefix}}_ApiBase_H_ */




© 2015 - 2024 Weber Informatics LLC | Privacy Policy