Api.getErrorDialog would be smarter, forgot about that.