1 #pragma once 2 3 #include <exception> 4 #include <pangolin/platform.h> 5 #include <string> 6 7 namespace pangolin { 8 9 struct PANGOLIN_EXPORT VideoException : std::exception 10 { VideoExceptionVideoException11 VideoException(std::string str) : desc(str) {} VideoExceptionVideoException12 VideoException(std::string str, std::string detail) { 13 desc = str + "\n\t" + detail; 14 } throwVideoException15 ~VideoException() throw() {} whatVideoException16 const char* what() const throw() { return desc.c_str(); } 17 std::string desc; 18 }; 19 20 struct PANGOLIN_EXPORT VideoExceptionNoKnownHandler : public VideoException 21 { VideoExceptionNoKnownHandlerVideoExceptionNoKnownHandler22 VideoExceptionNoKnownHandler(const std::string& scheme) 23 : VideoException("No known video handler for URI '" + scheme + "'") 24 { 25 } 26 }; 27 28 } 29 30