KeyNotFoundException is the right one

This commit is contained in:
2014-04-11 12:18:39 +02:00
parent 0d297cfd36
commit 9f2fcb77b0

View File

@@ -490,7 +490,7 @@ namespace WorldOfPeacecraft
{
try {
return Values [name];
} catch (ArgumentOutOfRangeException e) {
} catch (KeyNotFoundException e) {
throw new ParsingException("The parameter '" + name + "' does not exist in block '" + Name + "'", e);
}
}
@@ -499,7 +499,7 @@ namespace WorldOfPeacecraft
{
try {
return int.Parse (Values [name]);
} catch (ArgumentOutOfRangeException e) {
} catch (KeyNotFoundException e) {
throw new ParsingException("The parameter '" + name + "' does not exist in block '" + Name + "'", e);
} catch (FormatException e) {
throw new ParsingException("The parameter '" + name + "' in block '" + Name + "' is not an integer (it was '" + Values [name] + "')", e);
@@ -512,7 +512,7 @@ namespace WorldOfPeacecraft
{
try {
return long.Parse (Values [name]);
} catch (ArgumentOutOfRangeException e) {
} catch (KeyNotFoundException e) {
throw new ParsingException("The parameter '" + name + "' does not exist in block '" + Name + "'", e);
} catch (FormatException e) {
throw new ParsingException("The parameter '" + name + "' in block '" + Name + "' is not a long (it was '" + Values [name] + "')", e);
@@ -525,7 +525,7 @@ namespace WorldOfPeacecraft
{
try {
return bool.Parse (Values [name]);
} catch (ArgumentOutOfRangeException e) {
} catch (KeyNotFoundException e) {
throw new ParsingException ("The parameter '" + name + "' does not exist in block '" + Name + "'", e);
} catch (FormatException e) {
throw new ParsingException ("The parameter '" + name + "' in block '" + Name + "' is not a bool (it was '" + Values [name] + "')", e);