someguynamedjosh/ouroboros

Improve formatting of the covariance error message

nyurik opened this issue · 4 comments

The error message "Ouroboros cannot automatically determine if this type is covariant" generated here is not easily readable because the description is too long without a single line break. I do not know if there are any other considerations for this, so didn't want to submit a trivial PR, but i think the message should be broken up into multiple lines to simplify reading when the error is generated inside an IDE without line wrapping. I don't think any of the built-in error messages rely on term width to wrap. Thanks for an awesome crate! (but I still hope it will become part of the core :) )

This is an excellent point, the current error is a lengthy description that should really start with a brief tag phrase.

Does "Unknown Covariance" followed by the original error sound good or is that too vague?

@joshua-maros the error already has a pretty good first line summary Ouroboros cannot automatically determine if this type is covariant. -- I think it is the later text that should be broken into lines

Ah, I see what you are saying now. I'll make that change.

Thanks! Also, you may want to reread that error message too, it took me a few reads to understand it. But then again, not sure how to make it more comprehensible. Thanks!!!