2013-10-03 22:02:07 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "util/exception.h"
|
2013-10-23 20:42:14 +00:00
|
|
|
#include "kernel/justification.h"
|
2013-10-03 22:02:07 +00:00
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
/**
|
|
|
|
\brief Elaborator and related components store the reason for
|
2013-10-23 20:42:14 +00:00
|
|
|
failure in justification objects.
|
2013-10-03 22:02:07 +00:00
|
|
|
*/
|
|
|
|
class elaborator_exception : public exception {
|
2013-10-23 20:42:14 +00:00
|
|
|
justification m_justification;
|
2013-10-03 22:02:07 +00:00
|
|
|
public:
|
2013-10-23 20:42:14 +00:00
|
|
|
elaborator_exception(justification const & j):m_justification(j) {}
|
2013-10-03 22:02:07 +00:00
|
|
|
virtual ~elaborator_exception() {}
|
|
|
|
virtual char const * what() const noexcept { return "elaborator exception"; }
|
2013-10-23 20:42:14 +00:00
|
|
|
justification const & get_justification() const { return m_justification; }
|
2013-11-27 20:19:54 +00:00
|
|
|
virtual exception * clone() const { return new elaborator_exception(m_justification); }
|
|
|
|
virtual void rethrow() const { throw *this; }
|
2013-10-03 22:02:07 +00:00
|
|
|
};
|
|
|
|
}
|