throw Exception when no doc.kml file found in kmz

This commit is contained in:
Peter Storch
2020-11-29 10:58:15 +01:00
parent 215c28be85
commit 4476a15558
2 changed files with 5 additions and 0 deletions
@@ -177,6 +177,10 @@ public class KmzTrackImporter implements TrackImporter {
zipInputStream.closeEntry();
}
if (trackId == null) {
Log.d(TAG, "Unable to find doc.kml in kmz");
throw new RuntimeException(context.getString(R.string.import_no_kml_file_found));
}
return trackId;
} catch (ImportParserException | ImportAlreadyExistsException e) {
Log.e(TAG, "Unable to import file", e);
+1
View File
@@ -290,6 +290,7 @@ limitations under the License.
<string name="import_unsupported_format">Unsupported file format</string>
<string name="import_parser_error">Parser error: %1$s</string>
<string name="import_unable_to_import_file">Unable to import file: %1$s</string>
<string name="import_no_kml_file_found">No doc.kml file found in KMZ</string>
<string name="import_error_info">%1$s: %2$s</string>
<string name="import_error_list_dialog_title">Files not imported</string>
<string name="import_file_imported">File %1$s imported</string>