From 3faea25fe0bcb9f72bfe3da185085ed634d1b162 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 30 Oct 2017 14:13:50 +0000 Subject: COMPMID-617: Adds validation to CLPoolingLayer Change-Id: Ied405a9c0e9746598d03ac6a944ad87e9b6494eb Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93680 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- src/core/Error.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core/Error.cpp') diff --git a/src/core/Error.cpp b/src/core/Error.cpp index 389e390736..2e699feeb9 100644 --- a/src/core/Error.cpp +++ b/src/core/Error.cpp @@ -28,7 +28,9 @@ #include #include -void arm_compute::error(const char *function, const char *file, const int line, const char *msg, ...) +using namespace arm_compute; + +Error arm_compute::create_error(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, ...) { char out[512]; va_list args; @@ -37,16 +39,14 @@ void arm_compute::error(const char *function, const char *file, const int line, vsnprintf(out + offset, sizeof(out) - offset, msg, args); va_end(args); - throw std::runtime_error(std::string(out)); + return Error(error_code, std::string(out)); } -void arm_compute::debug(const char *function, const char *file, const int line, const char *msg, ...) +void arm_compute::error(const char *function, const char *file, const int line, const char *msg, ...) { - char out[512]; va_list args; va_start(args, msg); - int offset = snprintf(out, sizeof(out), "in %s %s:%d: ", function, file, line); - vsnprintf(out + offset, sizeof(out) - offset, msg, args); + auto err = create_error(ErrorCode::RUNTIME_ERROR, function, file, line, msg, args); va_end(args); - std::cout << std::string(out) << std::endl; + throw std::runtime_error(err.description()); } -- cgit v1.2.1