[minor fix] ensure errors are of type Error