Closed maxitg closed 3 years ago
@taliesinb, @daneelsan, this is ready for review. I don't plan to implement anything else here.
@taliesinb, @daneelsan, could you give an ETA on when can you look at this (I need it for Multihistory
)?
@maxitg Looking at it now
It seems there is/was an attempt to make Message
work with templates:
In[] := Message[MessageObject[<|"MessageSymbol" -> HoldForm[b],
"MessageTemplate" -> "Hello `world`!",
"MessageParameters" -> <|"world" -> 3|>|>]]; $Failed
Hello 3!
Out[] = $Failed
Changes
Failure
objects have anAssociation
as a second argument, which fits perfectly with specifying the arguments of the failure with descriptive keys.Failure
object directly into a message which would take the same keys as arguments.Message
function, however, does not support passingAssociation
arguments to the message strings.PackageScope
declareMessage
andmessage
that allow one to do that.message
can also directly takeFailure
objects and create messages from them.Comments
Multihistory
system where conversion functions and properties will need to report errors "far away" from where the messages will be produced.Failure
objects which will then be caught by a function from theMultihistory
infrastructure which will then generate a message with an appropriate head depending on which symbol triggered the conversion/property computation.Examples
Declare a message:
Generate a message:
Failure
:This change is