throw Questions
1
Solved
I have an INSERT trigger on one of my tables that issues a THROW when it finds a duplicate. Problem is my transactions seem to be implicitly rolled back at this point - this is a problem, I want to...
Fortunia asked 17/5, 2015 at 6:49
1
Solved
If I have following
function ValidationException(nr, msg){
this.message = msg;
this.name = "my exception";
this.number = nr;
}
function myFunction(dayOfWeek){
if(dayOfWeek > 7){
throw new...
Thready asked 2/4, 2015 at 20:53
1
Solved
I'm trying to throw an exception from the body of an ES6 generator function, but it's not going through. Is this part of the ES6 specification or a quirk of Babel?
Here is the code I tried (on bab...
Extrabold asked 28/3, 2015 at 16:22
2
Solved
I want my program exceptions to be sent to each of the following, preferably simultaneously:
the console which starts it (not necessarily)
a gui
a txt file.
How can I achieve this?
My attempts...
3
Solved
Normally it would be destructed upon the scope ending.. I could see issues occurring if exceptions were thrown though.
Flak asked 18/2, 2015 at 16:30
5
Solved
I want to overload the throw keyword to catch a class which inherits from Exception and to have it do some logging and other stuff before the actual throw. Is this possible? Or do I have to use a r...
4
Solved
I am trying to make it clear of the difference between Throws in method signature and Throw Statements in Java.
Throws in method signature is as following:
public void aMethod() throws IOException...
3
Solved
I'm trying to throw an exception (without using a try catch block) and my program finishes right after the exception is thrown. Is there a way that after I throw the exception, to then continue exe...
2
Solved
I have a simple javascript package I'm trying to test. I want to check for an Error being thrown, but when my test is run, and the error is thrown, the test is marked as failing.
Here's the code:
...
Pachston asked 27/9, 2014 at 7:28
4
Solved
Can someone show to throw exception to client in GWT.
in my serviceasync interface i am doing this as well in my service interface
void ActivateUserAccount(String ActivationCode,AsyncCallback &l...
2
Solved
I'm trying to write a unit test that detects an invalid use of the lock() feature of my class. In order to do so, I want to use the destructor and throw an exception from there. Unfortunately, inst...
Afterguard asked 13/10, 2014 at 0:20
3
Solved
Can any one clearly state the difference between throw and throws in Java exception handling with an example? I have tried googling but couldn't arrive at a conclusion. Pls help
3
Solved
I noticed by accident that this throw statement (extracted from some more complex code) compiles:
void foo() {
try {
} catch (Throwable t) {
throw t;
}
}
For a brief but happy moment I thou...
Rhoden asked 27/7, 2014 at 14:1
1
Solved
Running this with mocha results in timing out, rather than letting mocha catch the error so it could fail immediately..
var when = require('when');
var should = require('should');
describe('', fu...
3
Solved
Can anyone please confirm me if this information is correct or not:
In C++, inside catch block we can re-throw an exception using throw statement, but the thrown exception should have the same typ...
1
Solved
I'm parsing JSON from a server that contains statusCode and statusMessage... How do I throw these in my exception so that I don't have to use if-statements in my catch? So that I can have a generic...
5
How do you throw more than one exception at once from one method? Example:
public void doA() throws Exception1, Exception2{
throw new Exception1("test1");
throw new Exception2("test2");
}
...
1
Solved
What is the difference between @throw NSException and NSException raise? I wonder which one I should rather use (there is a proper use case to use one) and why?
Scan asked 14/2, 2014 at 9:27
2
Can anyone tell me difference between throw and throw ex in brief?
I read that throw stores previous exceptions, not getting this line.
Can i get this in brief with example?
2
Solved
You are apparently able to rethrow an Exception without discarding the stack trace in .NET.
However it doesn't appear to be working.
Basic usage I'm following is thus:
[WebMethod]
public void ...
1
I have following code . . .
@try
{
NSArray * array = [[NSArray alloc] initWithObjects:@"1",@"2",nil];
// the below code will raise an exception
[array objectAtIndex:11];
}
@catch(NSException...
Salvidor asked 7/10, 2013 at 4:29
2
Solved
With Google Mock 1.7.0, I have a mock object with a method, and I want to expect it to be called, and in this case the mocked method should throw an exception.
ObjectMock object_mock_;
EXPECT_CALL...
Carpenter asked 24/1, 2014 at 15:34
1
Solved
To reduce redundant code, I have some throw helper methods:
protected static X ThrowInvalidOperation(string operation, X a, X b) {
throw new InvalidOperationException("Invalid operation: " + a.ty...
7
Solved
I noticed that both of these, for example, are working:
public void func(int a) throws IllegalArgumentException {
if(a < 0)
throw new IllegalArgumentException("a should be greater than...
4
Solved
I have this code..
CEngineLayer::CEngineLayer(void)
{
// Incoming creation of layers. Wrapping all of this in a try/catch block is
// not helpful if logging of errors will happen.
logger = n...
Haga asked 5/12, 2010 at 6:45
© 2022 - 2024 — McMap. All rights reserved.