Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 47 lines (36 sloc) 1.067 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#include "settings.h"
#include "xscript/logger.h"
#include "xscript/operation_mode.h"
#include "xscript/response.h"
#include "xscript/util.h"

#ifdef HAVE_DMALLOC_H
#include <dmalloc.h>
#endif

namespace xscript {

class DevelopmentMode : public OperationMode {
public:
    DevelopmentMode();
    virtual ~DevelopmentMode();
    virtual void processError(const std::string& message);
    virtual void sendError(Response* response, unsigned short status, const std::string& message);
    virtual bool isProduction() const;
};

DevelopmentMode::DevelopmentMode() {
}

DevelopmentMode::~DevelopmentMode() {
}

void
DevelopmentMode::processError(const std::string& message) {
    log()->error("%s", message.c_str());
    throw UnboundRuntimeError(message);
}

void
DevelopmentMode::sendError(Response* response, unsigned short status, const std::string& message) {
    response->sendError(status, message);
}

bool
DevelopmentMode::isProduction() const {
    return false;
}

static ComponentRegisterer<OperationMode> reg_(new DevelopmentMode());

} // namespace xscript
Something went wrong with that request. Please try again.