You searched for exceptions
. We found 168
results in 0.081 seconds.
I suspect the problem is that you're not reading to the end of the containing element - I suspect you want: public void ReadXml(XmlReader reader) { Name = reader.ReadElementContentAsString(); } The documentation for ReadXml states: ... more
Well yes - look at the declaration of the method you're implementing: void actionPerformed(ActionEvent e) It isn't declared to throw any checked exceptions. So you can't add a checked exception such as IOException with a throws clause.... more
It will entirely depend on the implementation of the resource itself. The try-with-resource statement is "just" syntactic sugar (but oh so sweet) for calling close() within a finally block (and preserving exceptions etc). So long as the... more
if I understand correctly, the using statement works like a try/finally Correct. so I would expect that if an exception occurs in a using statement, it should not crash the program. Incorrect. Neither try/finally nor using... more
How can I get rid of this error? The problem is that if the BufferedReader or FileReader constructor throws an exception, br will be null but you're still unconditionally calling br.close(). Check whether br is null before you close... more
await is basically a shorthand for the continuation, by default using the same synchronization context for the continuation. For very simple examples like yours, there's not much benefit in using await - although the wrapping and... more
Yes - your Example class is effectively declaring: public Example() { super(); } That won't compile, because the super() call is calling the A() constructor which is declared to throw Exception, which is a checked exception. That's... more
I strongly suspect that this line is the problem: var loggedinuser = RavenSession.Load<ContentPage>("NotifyUser/" + user) as NotifyUser; loggedinuser will be null if the Load method actually returns something other than a... more
Now you've given an example of how you want to call it, I suspect that using dynamic typing may be the simplest approach: public void DoSomething(params object[] values) { foreach (dynamic value in values) { // Overload... more
Just don't do that to start with - it's an abuse of exceptions, IMO. Write the code so it's safe without try/catch. If you don't know whether HR is long enough, use: int cappedEnd = Math.Min(HR.Length, End); for (int i = Start; i <... more