KeyNotFoundException is the right one
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user