exception-handling

llvm exceptions - RaiseException “?:Unknown signal”

假装没事ソ 提交于 2020-01-03 12:32:07
问题 I'm trying to get exceptions working with llvm for a very simple example, that I can later build on but i'm running into some real difficulties and i'm not sure why. I got clang to give me the following llir code, that I am passing into the MCJIT ; llvm-as c++exn.ll && llvm-ld -native c++exn.bc -lstdc++.6 && ./a.out %"class.std::ios_base::Init" = type { i8 } %"class.std::basic_ostream" = type { i32 (...)**, %"class.std::basic_ios" } %"class.std::basic_ios" = type { %"class.std::ios_base", %

Properties of Inner Exception are Disposed?

筅森魡賤 提交于 2020-01-03 12:29:29
问题 I am writing a unit test for a WCF web service. I am deliberately sending an invalid request to the server which throws a WebExceptionFault<string> . In the unit test, the Exception that gets caught is an EndpointNotFoundException with the standard WebException in the InnerException property. I want to verify the body of the response matches the string that I think should be there. I am coming accross a problem, however, as the Response property of the WebException (which is a System.Net

Is it safe to share exception instance

倖福魔咒の 提交于 2020-01-03 08:39:42
问题 We are making an Excel-like system. When we open a document and found unsupported functions we threw exception. We just support small subset of excel functions, this could happen frequently. The problem is when there are a lot of cells that contains unsupported functions, lots and lots of exception instances are created. And creating those many exception instances consumes unignorable amount of time. We don't have any special properties within the exception class. What we need to know is the

unhandled exception: java.lang.ClassNotFoundException Error

泪湿孤枕 提交于 2020-01-03 07:06:46
问题 I have the following Class code and when Debug it kept showing the following error: 1.) Unhandled Exception: java.lang.ClassNotfoundException 2.) Unhandled Exception:java.lang.NoSuchMethodException Error Log: /apps/robotapp/Utils.java:32: error: exception IOException is never thrown in body of corresponding try statement } catch (IOException e) { ^ /apps/robotapp/Utils.java:24: error: unreported exception ClassNotFoundException; must be caught or declared to be thrown final int tckName =

Spring MVC: Get i18n message for reason in @RequestStatus on a @ExceptionHandler

一笑奈何 提交于 2020-01-03 05:10:10
问题 I have a Spring boot app with Thymeleaf mixing normal Controller calls that fetch views and REST async calls. For error handling in REST async calls, I would like to be able to provide a property as reason in exception handling and have it translated automatically by a MessageSource. My handler is as follow. @ExceptionHandler(Exception.class) @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "general.unexpected.exception") public ModelAndView handleUnexpectedException(Exception

Error 401 in C#

不羁岁月 提交于 2020-01-03 02:26:20
问题 I'm working on my first app for Windows 8 but I have a problem, when I'm launch my app, I've got the error "Response status code does not indicate success: 401 (Authorization Required) So yes, I need to include username and password but I don't know where in my code: var fond = new HttpClient(); var reponse = await fond.GetStreamAsync("http://example.com/search/mario%20kart" + TitleNewsGrid.Text); So where I'm include the username and password in the code? 回答1: There should be a Credentials

Render failing to render correct template in rescue_from ActiveRecord::Rollback method

瘦欲@ 提交于 2020-01-02 23:59:24
问题 I'm building the checkout page for an e-commerce site, and I have a fairly long transaction that creates a new User model and a new Order model. I wrapped the creation of these models in a transaction so that if validation for one fails, the other isn't hanging around in the database. Here's the trimmed-down code in my OrdersController: rescue_from ActiveRecord::Rollback, with: :render_new def render_new render action: 'new' end ActiveRecord::Base.transaction do @user = User.new params[:user]

Propagating exceptions through dlsym cython

烂漫一生 提交于 2020-01-02 15:06:56
问题 I am unable to propagate exceptions through dlsym. I use dlsym to load a cythonized python file. I made a minimal working example below so you can try it yourself: I have a pyx file, c_fun.pyx, which I compile to a C file using Cython. Then I'm using dlsym to load in the so file in another program, say use_fun.c++. You can use ./compile.sh to compile the files. On executing ./test, the program crashes with a segmentation fault. #c_fun.pyx: cdef public double _myfunction(double x) except*: a=1

How did I crash in a @try/@catch block?

♀尐吖头ヾ 提交于 2020-01-02 10:28:09
问题 I received the following crash report (truncated) Exception Type: EXC_CRASH (SIGSEGV) Exception Codes: 0x00000000, 0x00000000 Crashed Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x36df00d8 __psynch_mutexwait + 24 1 libsystem_c.dylib 0x31760674 pthread_mutex_lock + 376 2 CoreFoundation 0x31f2338a CFRunLoopWakeUp + 50 3 WebCore 0x308d0bc8 _WebThreadRun + 284 4 UIKit 0x37921c7a -[UIWebDocumentView _runLoadBlock:] + 38 5 UIKit

“The state information is invalid for this page and might be corrupted”

核能气质少年 提交于 2020-01-02 10:07:30
问题 My asp.net application has a master page, a content page and a user control. In the main master page there is a link which displays a fancybox as an iframe. The iframe has a form to login to the page. The iframe is a new masterpage which has the content page of the login which has the user control of the login. When the user clicks on the button to login the server side checks if the credentials are ok and if not it displays a message. All this with a custom validator. My problem is that when