I also converted the error from `InternalError` to `UserError`. So far I've intented to use `InternalError` only to indicate bugs or corrupt repos. I'm not sure that's a good idea, and we can revisit it later.