Use `ex-info` over `RuntimeException` to provide more detailed errors

This commit modifies a few places in the code that were throwing
raw `RuntimeException` instances to prefer `ex-info` instead.  This
way, a map containing detailed error info can also be included,
which allows callers to inspect the exception more intelligently.

The message strings for the exceptions are not changed, and the
resulting exception still inherits from `RuntimeException`, so
this should theoretically be backwards-compatible with the
previous code.