@@ -474,19 +474,19 @@ FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFil
474474 if (pf.bundle ) {
475475 String simplified_path = p_path.simplify_path ();
476476 f = FileAccess::open (simplified_path, FileAccess::READ | FileAccess::SKIP_PACK );
477+ ERR_FAIL_COND_MSG (f.is_null (), vformat (R"( Can't open pack-referenced file "%s" from sparse pack "%s".)" , simplified_path, pf.pack ));
477478 off = 0 ; // For the sparse pack offset is always zero.
478479 } else {
479480 f = FileAccess::open (pf.pack , FileAccess::READ );
481+ ERR_FAIL_COND_MSG (f.is_null (), vformat (R"( Can't open pack-referenced file "%s" from pack "%s".)" , p_path, pf.pack ));
480482 f->seek (pf.offset );
481483 off = pf.offset ;
482484 }
483485
484- ERR_FAIL_COND_MSG (f.is_null (), vformat (" Can't open pack-referenced file '%s'." , String (pf.pack )));
485-
486486 if (pf.encrypted ) {
487487 Ref<FileAccessEncrypted> fae;
488488 fae.instantiate ();
489- ERR_FAIL_COND_MSG (fae.is_null (), vformat (" Can't open encrypted pack-referenced file '%s'. " , String ( pf.pack ) ));
489+ ERR_FAIL_COND_MSG (fae.is_null (), vformat (R"( Can't open encrypted pack-referenced file "%s" from pack "%s". ) " , p_path, pf.pack ));
490490
491491 Vector<uint8_t > key;
492492 key.resize (32 );
@@ -495,7 +495,7 @@ FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFil
495495 }
496496
497497 Error err = fae->open_and_parse (f, key, FileAccessEncrypted::MODE_READ , false );
498- ERR_FAIL_COND_MSG (err, vformat (" Can't open encrypted pack-referenced file '%s'. " , String ( pf.pack ) ));
498+ ERR_FAIL_COND_MSG (err, vformat (R"( Can't open encrypted pack-referenced file "%s" from pack "%s". ) " , p_path, pf.pack ));
499499 f = fae;
500500 off = 0 ;
501501 }
0 commit comments