initiate an error message when constraint or typesystem rule is violated on rebuild in sandbox

Hello forum!

My question is if it's possible to define such an error message on the rebuild or build process in a sandbox solution if a constraint or type system checking rule is violated.

The error message in the editor is unfortunately not enough, because on a rebuild of the sandbox solution the user wants in my case a message that he has done something wrong.

I appreciate every hint. Thanks!

Regards

m sch95

5 comments
Comment actions Permalink

MPS->Preferences->Build, Execution, Deployment->Generator you can check "Check models for errors before generation". Then, you could use the logging language within your typesystem rules to provide your custom messages.

1
Comment actions Permalink

For instance, you can use the warning statement that is declared in jetbrains.mps.lang.typesystem. The typesystem provides you a nice overview on the current problems (see below). This is better practice than using the warn statement that comes from the logging language.

1
Comment actions Permalink

Thanks Ben! Problem solved!

0
Comment actions Permalink

Glad to hear that. Sorry, it's still to early in the morning :D Of course, you don't need the logging language in the typesystem rules. Use the typesystem messages instead.

0
Comment actions Permalink

What do you mean with typesystem messages?

As I said, I'm using a non-typesystem-rule with an error log message atm.

0

Please sign in to leave a comment.