Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions kaitai/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,27 @@ class validation_not_any_of_error: public validation_failed_error {
const T& m_actual;
};

/**
* Signals validation failure: we required "actual" value to match
* the regex, but it turned out that it's not.
*/
template<typename T>
class validation_regex_match_error: public validation_failed_error {
public:
validation_regex_match_error<T>(const T& regex, const T& actual, const kstream* io, const std::string src_path):
validation_failed_error("no regex match", io, src_path),
m_actual(actual)
{
}

// "not any of the list, got #{actual.inspect}"

virtual ~validation_regex_match_error<T>() KS_NOEXCEPT {};

protected:
const T& m_actual;
};

}

#endif