Make ErrorCode an interface

This turns out to be weird. Name it `toErrorCode()`.