mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
better error message when we can't read trasnlation template
This commit is contained in:
parent
a49a462f45
commit
f2ddedd5eb
@ -374,9 +374,13 @@ namespace Twiglet.CS2J.Translator
|
|||||||
|
|
||||||
txStream.Seek(0, SeekOrigin.Begin);
|
txStream.Seek(0, SeekOrigin.Begin);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
TypeRepTemplate t = TypeRepTemplate.newInstance(txStream);
|
TypeRepTemplate t = TypeRepTemplate.newInstance(txStream);
|
||||||
// Fullname has form: <path>/<key>.xml
|
// Fullname has form: <path>/<key>.xml
|
||||||
AppEnv[t.TypeName+(t.TypeParams != null && t.TypeParams.Length > 0 ? "'" + t.TypeParams.Length.ToString() : "")] = t;
|
AppEnv[t.TypeName+(t.TypeParams != null && t.TypeParams.Length > 0 ? "'" + t.TypeParams.Length.ToString() : "")] = t;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Console.WriteLine ("WARNING -- Could not import " + fullName + " (" + e.Message + ")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Here's where we do the real work...
|
// Here's where we do the real work...
|
||||||
|
@ -2219,7 +2219,6 @@ namespace Twiglet.CS2J.Translator.TypeRep
|
|||||||
// class, interface, enum, etc.
|
// class, interface, enum, etc.
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
try {
|
|
||||||
while (reader.Read () && !found) {
|
while (reader.Read () && !found) {
|
||||||
if (reader.NodeType == XmlNodeType.Element) {
|
if (reader.NodeType == XmlNodeType.Element) {
|
||||||
switch (reader.LocalName) {
|
switch (reader.LocalName) {
|
||||||
@ -2247,9 +2246,6 @@ namespace Twiglet.CS2J.Translator.TypeRep
|
|||||||
}
|
}
|
||||||
s.Seek (0, SeekOrigin.Begin);
|
s.Seek (0, SeekOrigin.Begin);
|
||||||
ret = (TypeRepTemplate)Deserialize (s, System.Type.GetType (typeType));
|
ret = (TypeRepTemplate)Deserialize (s, System.Type.GetType (typeType));
|
||||||
} catch (Exception e) {
|
|
||||||
Console.WriteLine ("WARNING -- (Deserialize) " + e.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user