-
Notifications
You must be signed in to change notification settings - Fork 111
Add Optional error codes to identify errors #60
Comments
What do you mean? Do you have an example? |
I am building a library that's called from languages. More explicitly, I am writing multiple plugins for IDEs. Each IDE has its own plugin and system language. As such, not to have to rewrite most of the logic, I use rust as a common backend. I use Json to communicate, transmitted with pointers as strings to communicate between the rust and the plugin. One of the shortcoming of that serialization are two things with |
You mean that you want to be able to associate some data to an error? |
yes, data conditional to the type of the error |
You can already do that for normal errors, and you would like to do it for |
What do you mean, I can do it for normal errors? In the As for the macro change we could have a codes {
Temp, "#0001";
} To access it we could have a |
you can do
I don't really see what would be the benefit. I thought you where talking about getting the code above to work with links |
I was, the However, if we can use the result of the mapping to add custom fields then there might not need any addition to the macro. |
something like this then? foreign_links {
io::Error, Io<u16>;
} |
Hi,
When interacting rust code with other languages, we can't do pattern matching on error types.
As a consequence being able to add a method to define error code according of the type of the error would be great.
Thank you
The text was updated successfully, but these errors were encountered: