chat: virtualize message-to-json only where needed
Previously we were virtualizing all message rendering operations, but it's only
+tank:enjs:format that we're worried about here.
Doing this more narrowly also allows us to specify a slightly more specific
error message.
=, enjs:format
|= =letter
^- json
- =; result=(each json tang)
- ?- -.result
- %& p.result
- %| (frond %text s+'[[json rendering error]]')
- ==
- %- mule
- |.
?- -.letter
%text
(frond %text s+text.letter)
%code
%+ frond %code
%- pairs
- :~ [%expression s+expression.letter]
- [%output a+(turn output.letter tank)]
+ :- [%expression s+expression.letter]
+ :_ ~
+ :- %output
+ :: virtualize output rendering, +tank:enjs:format might crash
+ ::
+ =/ result=(each (list json) tang)
+ (mule |.((turn output.letter tank)))
+ ?- -.result
+ %& a+p.result
+ %| a+[a+[%s '[[output rendering error]]']~]~
==
::
%me
