lean2/src/library/error_handling/error_handling.h
Leonardo de Moura 8ab775bd6f feat(*): distinguish between logical and runtime exceptions.
Now, we use throwable as the new base class for all Lean exceptions, and
exception is the subclass for "logical" exceptions.
2015-01-15 16:54:55 -08:00

28 lines
1.3 KiB
C++

/*
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"
#include "kernel/pos_info_provider.h"
#include "library/io_state_stream.h"
namespace lean {
/**
\brief Display position information associated with \c e (IF avaiable).
If it is not available, it just displays "error:"
*/
void display_error_pos(io_state_stream const & ios, pos_info_provider const * p, expr const & e);
/** \brief Display position information + "error:" */
void display_error_pos(io_state_stream const & ios, char const * strm_name, unsigned line, unsigned pos);
/** \brief Similar to #display_error_pos, but displays a "warning:" */
void display_warning_pos(io_state_stream const & ios, char const * strm_name, unsigned line, unsigned pos);
void display_information_pos(io_state_stream const & ios, char const * strm_name, unsigned line, unsigned pos);
/**
\brief Display exception in the regular stream of \c ios, using the configuration options and formatter from \c ios.
Exceptions that contain expressions use the given \c pos_info_provider (if available) to retrieve line number information.
*/
void display_error(io_state_stream const & ios, pos_info_provider const * p, throwable const & ex);
}