aboutsummaryrefslogtreecommitdiff
path: root/src/core/Error.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-10-30 14:13:50 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit3faea25fe0bcb9f72bfe3da185085ed634d1b162 (patch)
treea53a50bf9e889b9d913dc47d5375a382aed57e58 /src/core/Error.cpp
parentb5908c257d554009a00de3aaa95b3721000ed185 (diff)
downloadComputeLibrary-3faea25fe0bcb9f72bfe3da185085ed634d1b162.tar.gz
COMPMID-617: Adds validation to CLPoolingLayer
Change-Id: Ied405a9c0e9746598d03ac6a944ad87e9b6494eb Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93680 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/Error.cpp')
-rw-r--r--src/core/Error.cpp14
1 files changed, 7 insertions, 7 deletions
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 <iostream>
#include <stdexcept>
-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());
}