chiark / gitweb /
Piece internal API overhaul: pass PieceState, fallible
Magic pieces are going to need to look at their state to decide how
to format themselves, and that is fallible.
Make formatting methods on PieceState fallible. They return
InternalError. Pass these methods &PieceState.
Textually extremely intrusive, but no functional change with existing
actually-infallible call sites.
We provide infallible versions of the describe_html functions, which
return a placeholder if there is an error. This is because typically
at their call sites, returning an error is very inconvenient. Eg, it
happens after a game update has actually occurred.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>