Pattern-match helper — only handle error.
void ifError(void Function(String error, String message) callback) { if (this case ApiError<T> e) callback(e.error, e.message); }