telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 5 | #include <armnn/Exceptions.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 6 | |
| 7 | #include <string> |
| 8 | |
| 9 | namespace armnn |
| 10 | { |
| 11 | |
| 12 | Exception::Exception(const std::string& message) |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 13 | : m_Message{message} |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 14 | { |
| 15 | } |
| 16 | |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 17 | Exception::Exception(const std::string& message, |
| 18 | const CheckLocation& location) |
| 19 | : m_Message{message} |
| 20 | { |
| 21 | m_Message += location.AsString(); |
| 22 | } |
| 23 | |
| 24 | Exception::Exception(const Exception& other, |
| 25 | const std::string& message, |
| 26 | const CheckLocation& location) |
| 27 | : m_Message{other.m_Message} |
| 28 | { |
| 29 | m_Message += "\n" + message + location.AsString(); |
| 30 | } |
| 31 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 32 | const char* Exception::what() const noexcept |
| 33 | { |
| 34 | return m_Message.c_str(); |
| 35 | } |
| 36 | |
| 37 | UnimplementedException::UnimplementedException() |
| 38 | : Exception("Function not yet implemented") |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | } |