Access to Compiler Error in Callbacks

Hi all,

I am working under project prusti, which is a verification tool against rust. The tool is designed to be a plugin that work along with the compiler and verify the user's source code if they annotate it with our syntax.

Recently I am trying to implement a new feature in the project and I would like to access the error recorded during rust compile and map it to a more clear prusti internal error, is there any API available for doing that? If there isn't I wonder if it's possible to have that in rust so that it allows the plugin developer to have more freedom to decide what they want to do with the errors? (like a mutable reference to error or to be able to register a callback to deal with error)