Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
This commit is contained in:
@ -1207,7 +1207,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres
|
||||
const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid];
|
||||
mesh->set_name(meshdata.name);
|
||||
Error err = _create_mesh_surfaces(morphs.size() == 0, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, morph, morphs, p_use_compression, use_mesh_builtin_materials);
|
||||
ERR_FAIL_COND_V(err, err);
|
||||
ERR_FAIL_COND_V_MSG(err, err, "Cannot create mesh surface.");
|
||||
|
||||
mesh_cache[meshid] = mesh;
|
||||
} else {
|
||||
@ -1259,7 +1259,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres
|
||||
Error ColladaImport::load(const String &p_path, int p_flags, bool p_force_make_tangents, bool p_use_compression) {
|
||||
|
||||
Error err = collada.load(p_path, p_flags);
|
||||
ERR_FAIL_COND_V(err, err);
|
||||
ERR_FAIL_COND_V_MSG(err, err, "Cannot load file '" + p_path + "'.");
|
||||
|
||||
force_make_tangents = p_force_make_tangents;
|
||||
ERR_FAIL_COND_V(!collada.state.visual_scene_map.has(collada.state.root_visual_scene), ERR_INVALID_DATA);
|
||||
@ -1777,7 +1777,7 @@ Node *EditorSceneImporterCollada::import_scene(const String &p_path, uint32_t p_
|
||||
|
||||
Error err = state.load(p_path, flags, p_flags & EditorSceneImporter::IMPORT_GENERATE_TANGENT_ARRAYS, p_flags & EditorSceneImporter::IMPORT_USE_COMPRESSION);
|
||||
|
||||
ERR_FAIL_COND_V(err != OK, NULL);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, NULL, "Cannot load scene from file '" + p_path + "'.");
|
||||
|
||||
if (state.missing_textures.size()) {
|
||||
|
||||
@ -1830,7 +1830,7 @@ Ref<Animation> EditorSceneImporterCollada::import_animation(const String &p_path
|
||||
state.use_mesh_builtin_materials = false;
|
||||
|
||||
Error err = state.load(p_path, Collada::IMPORT_FLAG_ANIMATION, p_flags & EditorSceneImporter::IMPORT_GENERATE_TANGENT_ARRAYS);
|
||||
ERR_FAIL_COND_V(err != OK, RES());
|
||||
ERR_FAIL_COND_V_MSG(err != OK, RES(), "Cannot load animation from file '" + p_path + "'.");
|
||||
|
||||
state.create_animations(p_flags & EditorSceneImporter::IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS, p_flags & EditorSceneImporter::IMPORT_ANIMATION_KEEP_VALUE_TRACKS);
|
||||
if (state.scene)
|
||||
|
||||
@ -2411,14 +2411,14 @@ Error EditorSceneImporterGLTF::_parse_animations(GLTFState &state) {
|
||||
track->weight_tracks.write[k] = cf;
|
||||
}
|
||||
} else {
|
||||
WARN_PRINTS("Invalid path: " + path);
|
||||
WARN_PRINTS("Invalid path '" + path + "'.");
|
||||
}
|
||||
}
|
||||
|
||||
state.animations.push_back(animation);
|
||||
}
|
||||
|
||||
print_verbose("glTF: Total animations: " + itos(state.animations.size()));
|
||||
print_verbose("glTF: Total animations '" + itos(state.animations.size()) + "'.");
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const
|
||||
|
||||
FileAccessRef f = FileAccess::open(p_source_file, FileAccess::READ);
|
||||
|
||||
ERR_FAIL_COND_V(!f, ERR_INVALID_PARAMETER);
|
||||
ERR_FAIL_COND_V_MSG(!f, ERR_INVALID_PARAMETER, "Cannot open file from path '" + p_source_file + "'.");
|
||||
|
||||
Vector<String> line = f->get_csv_line(delimiter);
|
||||
ERR_FAIL_COND_V(line.size() <= 1, ERR_PARSE_ERROR);
|
||||
|
||||
@ -78,7 +78,7 @@ Error ResourceImporterImage::import(const String &p_source_file, const String &p
|
||||
|
||||
FileAccess *f = FileAccess::open(p_source_file, FileAccess::READ);
|
||||
|
||||
ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
|
||||
ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, "Cannot open file from path '" + p_source_file + "'.");
|
||||
|
||||
size_t len = f->get_len();
|
||||
|
||||
@ -90,6 +90,7 @@ Error ResourceImporterImage::import(const String &p_source_file, const String &p
|
||||
memdelete(f);
|
||||
|
||||
f = FileAccess::open(p_save_path + ".image", FileAccess::WRITE);
|
||||
ERR_FAIL_COND_V_MSG(!f, ERR_CANT_CREATE, "Cannot create file in path '" + p_save_path + ".image'.");
|
||||
|
||||
//save the header GDIM
|
||||
const uint8_t header[4] = { 'G', 'D', 'I', 'M' };
|
||||
|
||||
@ -509,7 +509,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
|
||||
|
||||
err = ResourceSaver::save(save_path, meshes.front()->get());
|
||||
|
||||
ERR_FAIL_COND_V(err != OK, err);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot save Mesh to file '" + save_path + "'.");
|
||||
|
||||
r_gen_files->push_back(save_path);
|
||||
|
||||
|
||||
@ -1418,7 +1418,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
|
||||
DirAccess *da = DirAccess::open(base_path);
|
||||
Error err2 = da->make_dir(subdir_name);
|
||||
memdelete(da);
|
||||
ERR_FAIL_COND_V(err2 != OK && err2 != ERR_ALREADY_EXISTS, err2);
|
||||
ERR_FAIL_COND_V_MSG(err2 != OK && err2 != ERR_ALREADY_EXISTS, err2, "Cannot make directory '" + subdir_name + "'.");
|
||||
base_path = base_path.plus_file(subdir_name);
|
||||
}
|
||||
}
|
||||
@ -1514,7 +1514,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
|
||||
Ref<PackedScene> packer = memnew(PackedScene);
|
||||
packer->pack(child);
|
||||
err = ResourceSaver::save(path, packer); //do not take over, let the changed files reload themselves
|
||||
ERR_FAIL_COND_V(err != OK, err);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot save scene to file '" + path + "'.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1522,7 +1522,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
|
||||
packer->pack(scene);
|
||||
print_verbose("Saving scene to: " + p_save_path + ".scn");
|
||||
err = ResourceSaver::save(p_save_path + ".scn", packer); //do not take over, let the changed files reload themselves
|
||||
ERR_FAIL_COND_V(err != OK, err);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot save scene to file '" + p_save_path + ".scn'.");
|
||||
|
||||
memdelete(scene);
|
||||
|
||||
@ -1549,7 +1549,7 @@ Node *EditorSceneImporterESCN::import_scene(const String &p_path, uint32_t p_fla
|
||||
|
||||
Error error;
|
||||
Ref<PackedScene> ps = ResourceFormatLoaderText::singleton->load(p_path, p_path, &error);
|
||||
ERR_FAIL_COND_V(!ps.is_valid(), NULL);
|
||||
ERR_FAIL_COND_V_MSG(!ps.is_valid(), NULL, "Cannot load scene as text resource from path '" + p_path + "'.");
|
||||
|
||||
Node *scene = ps->instance();
|
||||
ERR_FAIL_COND_V(!scene, NULL);
|
||||
|
||||
@ -96,7 +96,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
|
||||
Error err;
|
||||
FileAccess *file = FileAccess::open(p_source_file, FileAccess::READ, &err);
|
||||
|
||||
ERR_FAIL_COND_V(err != OK, ERR_CANT_OPEN);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, ERR_CANT_OPEN, "Cannot open file '" + p_source_file + "'.");
|
||||
|
||||
/* CHECK RIFF */
|
||||
char riff[5];
|
||||
|
||||
Reference in New Issue
Block a user