Skip to content

Commit

Permalink
Improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmaxwell3 committed Jul 30, 2024
1 parent f4c4ed7 commit fcc9ec0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@
<comment>Shown during import. The current entry is supposed to be shown as a subentry under "{1}".</comment>
</data>
<data name="ksWrongVernWs" xml:space="preserve">
<value>Warning: {0} has the wrong default vernacular writing system (expecting {1}, was {2}).</value>
<value>Error: {0} has the wrong default vernacular writing system (expecting {1}, was {2}). Import aborted.</value>
</data>
<data name="ksWrongVersion" xml:space="preserve">
<value>Warning: {0} has an invalid version number (expecting {1}, was {2}).</value>
<value>Error: {0} has an invalid version number (expecting {1}, was {2}). Import aborted.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,13 @@ public void ImportData(TextReader rdr, TextWriter wrtrLog, IProgress progress)
if (versionId != null && versionId != PhonologyServices.VersionId)
{
string sMsg = String.Format(AppStrings.ksWrongVersion, m_sFilename, PhonologyServices.VersionId, versionId);
LogMessage(sMsg, LineNumber(xrdr));
throw new Exception(sMsg);
}
string vernWs = xrdr.GetAttribute("DefaultVernWs");
string cacheVernWs = m_cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem.IcuLocale;
if (vernWs != null && vernWs != cacheVernWs)
{
string sMsg = String.Format(AppStrings.ksWrongVernWs, m_sFilename, cacheVernWs, vernWs);
LogMessage(sMsg, LineNumber(xrdr));
throw new Exception(sMsg);
}
xrdr.Read();
Expand Down

0 comments on commit fcc9ec0

Please sign in to comment.