-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail on unknown properties #2837
Conversation
message.Append(prefix.AsSpan(0, prefix.Length - 1)); | ||
message.Append("':"); | ||
foreach (string p in unknownProps) | ||
{ | ||
message.Append("\n "); | ||
message.Append(p); | ||
} | ||
Ice.Util.getProcessLogger().warning(message.ToString()); | ||
throw new InvalidOperationException(message.ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not clear what is the more appropriate exception here, this can be called from the dispatch when metrics are updated using the metrics admin facet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be a LocalException since we have a lot of code that expects only LocalException.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding a new UnknownPropertyException local exception - similar to ParseException?
{ | ||
var initData = new InitializationData(); | ||
initData.properties = createTestProperties(ref args); | ||
using (var communicator = initialize(initData)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a using declaration.
message.Append(prefix.AsSpan(0, prefix.Length - 1)); | ||
message.Append("':"); | ||
foreach (string p in unknownProps) | ||
{ | ||
message.Append("\n "); | ||
message.Append(p); | ||
} | ||
Ice.Util.getProcessLogger().warning(message.ToString()); | ||
throw new InvalidOperationException(message.ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be a LocalException since we have a lot of code that expects only LocalException.
message.Append(prefix); | ||
message.Append("':"); | ||
foreach (string s in unknownProps) | ||
{ | ||
message.Append("\n "); | ||
message.Append(s); | ||
} | ||
_instance.initializationData().logger.warning(message.ToString()); | ||
throw new InitializationException(message.ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's the right exception, and it can occur after communicator/OA initialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. What about Connection and ThreadPool properties?
For now, I'm just replacing the usage of |
This is the C# side of #2799