Move error type conversion to getProfile