@@ -1799,7 +1799,7 @@ void MetadataNode::BuildMetadata(const string& filesPath) {
1799
1799
1800
1800
// TODO: Is there a way to detect if the screen is locked as verification
1801
1801
// We assume based on the error that this is the only way to get this specific error here at this point
1802
- if (errno == 2 ) {
1802
+ if (errno == ENOENT ) {
1803
1803
// Log the error with error code
1804
1804
__android_log_print (ANDROID_LOG_ERROR, " TNS.error" , " %s" , ss.str ().c_str ());
1805
1805
@@ -1829,7 +1829,12 @@ void MetadataNode::BuildMetadata(const string& filesPath) {
1829
1829
1830
1830
FILE* f = fopen (nodesFile.c_str (), " rb" );
1831
1831
if (f == nullptr ) {
1832
- throw NativeScriptException (string (" metadata file (treeNodeStream.dat) couldn't be opened!" ));
1832
+ stringstream ss;
1833
+ ss << " metadata file (treeNodeStream.dat) couldn't be opened! (Error: " ;
1834
+ ss << errno;
1835
+ ss << " ) " ;
1836
+
1837
+ throw NativeScriptException (ss.str ());
1833
1838
}
1834
1839
fseek (f, 0 , SEEK_END);
1835
1840
int lenNodes = ftell (f);
@@ -1843,7 +1848,11 @@ void MetadataNode::BuildMetadata(const string& filesPath) {
1843
1848
1844
1849
f = fopen (namesFile.c_str (), " rb" );
1845
1850
if (f == nullptr ) {
1846
- throw NativeScriptException (string (" metadata file (treeStringsStream.dat) couldn't be opened!" ));
1851
+ stringstream ss;
1852
+ ss << " metadata file (treeStringsStream.dat) couldn't be opened! (Error: " ;
1853
+ ss << errno;
1854
+ ss << " ) " ;
1855
+ throw NativeScriptException (ss.str ());
1847
1856
}
1848
1857
fseek (f, 0 , SEEK_END);
1849
1858
int lenNames = ftell (f);
@@ -1854,7 +1863,11 @@ void MetadataNode::BuildMetadata(const string& filesPath) {
1854
1863
1855
1864
f = fopen (valuesFile.c_str (), " rb" );
1856
1865
if (f == nullptr ) {
1857
- throw NativeScriptException (string (" metadata file (treeValueStream.dat) couldn't be opened!" ));
1866
+ stringstream ss;
1867
+ ss << " metadata file (treeValueStream.dat) couldn't be opened! (Error: " ;
1868
+ ss << errno;
1869
+ ss << " ) " ;
1870
+ throw NativeScriptException (ss.str ());
1858
1871
}
1859
1872
fseek (f, 0 , SEEK_END);
1860
1873
int lenValues = ftell (f);
0 commit comments