Skip to content

Commit

Permalink
Add VideoExceptionNoKnownHandler.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenlovegrove committed May 4, 2017
1 parent 31ea3ca commit cad23ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion include/pangolin/video/video_exception.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <pangolin/platform.h>
#include <exception>
#include <pangolin/platform.h>
#include <string>

namespace pangolin {
Expand All @@ -17,5 +17,13 @@ struct PANGOLIN_EXPORT VideoException : std::exception
std::string desc;
};

struct PANGOLIN_EXPORT VideoExceptionNoKnownHandler : public VideoException
{
VideoExceptionNoKnownHandler(const std::string& scheme)
: VideoException("No known video handler for URI '" + scheme + "'")
{
}
};

}

2 changes: 1 addition & 1 deletion src/video/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ std::unique_ptr<VideoInterface> OpenVideo(const Uri& uri)
FactoryRegistry<VideoInterface>::I().Open(uri);

if(!video) {
throw VideoException("No known video handler for URI '" + uri.scheme + "'");
throw VideoExceptionNoKnownHandler(uri.scheme);
}

return video;
Expand Down

0 comments on commit cad23ac

Please sign in to comment.