Improve error reporting in the asset library and in related types

This also makes errors related to asset image loading
verbose-only, because, frankly, users can't do much about
those errors. Spamming them with error messages
about some assets on the frontend being broken
is pointless.
This commit is contained in:
Yuri Sizov
2024-01-26 20:33:22 +01:00
parent 17e7f85c06
commit 815038962f
7 changed files with 133 additions and 90 deletions

View File

@@ -81,7 +81,7 @@ void ImageFormatLoaderExtension::_bind_methods() {
}
Error ImageLoader::load_image(String p_file, Ref<Image> p_image, Ref<FileAccess> p_custom, BitField<ImageFormatLoader::LoaderFlags> p_flags, float p_scale) {
ERR_FAIL_COND_V_MSG(p_image.is_null(), ERR_INVALID_PARAMETER, "It's not a reference to a valid Image object.");
ERR_FAIL_COND_V_MSG(p_image.is_null(), ERR_INVALID_PARAMETER, "Can't load an image: invalid Image object.");
Ref<FileAccess> f = p_custom;
if (f.is_null()) {