exception-handling

Exception Error when I try to initialize hudson.war

﹥>﹥吖頭↗ 提交于 2019-12-12 01:40:02
问题 I have installed hudson on Ubuntu server and then run java -jar hudson.war, giving me this exception error message: Status Code: 500 Exception: The error below occurred during context initialisation, so no further requests can be processed: java.lang.ExceptionInInitializerError at java.lang.Class.initializeClass(libgcj.so.10) at hudson.WebAppMain.installLogger(WebAppMain.java:257) at hudson.WebAppMain.contextInitialized(WebAppMain.java:112) at winstone.WebAppConfiguration.(WebAppConfiguration

NSInvalidArgumentException not being caught in code

我的未来我决定 提交于 2019-12-12 01:33:44
问题 I'm using selectors to dynamically call functions in Objective-C. My problem is that my @try / @catch block is not catching the exception if I pass an non-existent function name. In the console I get an uncaught NSInvalidArgumentException and further down I get an uncaught NSException . I have tried catching the the two types of exceptions in a standard @try / @catch block but they aren't registering. Xcode won't let me compile if I try to catch NSInvalidArgumentException as it's not a

NameError, global not defined when using try,except

让人想犯罪 __ 提交于 2019-12-12 01:29:21
问题 Edit: Ignore this, I figured it out about 3 seconds after posting this but can't delete it =( I have this try, except code for working with RackSpace cloudfiles try: cacheobject = cachecontainer.get_object('file.jpg') except NoSuchObject as objectname: raise tornado.web.HTTPError(404) If 'file.jpg' is not found, the exception 'NoSuchObject' is raised. When I run this code I get the error except NoSuchObject as objectname: NameError: global name 'NoSuchObject' is not defined I tried putting

Uncaught exception in try/catch block

邮差的信 提交于 2019-12-11 23:59:03
问题 A method performs a recursive scan for yaml files and parses them, extracts some of the information. I use sfYamlParser to parse the yaml. I enclosed the call to parse() in a try block and catch "Exception $e" but I still get a "Fatal Error: uncaught exception. try{ $definition = $parser->parse(file_get_contents($filePath));//line 20 } catch(Exception $e) { throw new Exception("Parsing model definiion '$filePath' failed.", 0, $e); } Snippet from stack trace: ...Indexer.php(20): sfYamlParser-

Neither Application.ThreadException nor AppDomain.CurrentDomain.UnhandledException are respected

怎甘沉沦 提交于 2019-12-11 23:13:49
问题 First, within the Program.Program() static constructor I have this code: AppDomain.CurrentDomain.UnhandledException += (s, eargs) => LogException((Exception)eargs.ExceptionObject); Application.ThreadException += (s, eargs) => LogException(eargs.Exception); Then, if I deliberately do (for example) a divide-by-zero, it's caught. However, none of the other exceptions from within the thread loop are caught, like this one - its stack trace is: System.ComponentModel.ReflectPropertyDescriptor

Exception handling in Grails controllers with ExceptionMapper in Grails 2.2.4 best practice

若如初见. 提交于 2019-12-11 23:12:56
问题 While handling exception in Grails 2.2.4 with the scheme reported here: Exception handling in Grails controllers class ErrorController { def index() { def exception = request.exception.cause def message = ExceptionMapper.mapException(exception) def status = message.status response.status = status render(view: "/error", model: [status: status, exception: exception]) } } an exception is raised: groovy.lang.MissingPropertyException: No such property: ExceptionMapper for class: ErrorController

How to handle TaskCancelledException in Android Http postasync ? I keep getting unhandled exception and app crash

半世苍凉 提交于 2019-12-11 23:09:08
问题 Here is my method, i call it from the oncreate method: await httpPost(newscan); public async Task HttpPost(Scan s) { var client = new HttpClient(); // This timeout is whats causing the taskCancelledException.... client.Timeout = TimeSpan.FromSeconds(8); var cts = new CancellationToken(); try { var json = JsonConvert.SerializeObject(s); await client.PostAsync("http://10.0.0.103:4321/scan", new StringContent(json), cts); newScan.Success = "Success"; codes.Add(newScan.ScanValue + " " + DateTime

Catch exception calling “ExecuteNonQuery”

陌路散爱 提交于 2019-12-11 22:37:01
问题 I have a Powershell script that inserts a primary key value and another value into a SQL Server 2012 database. This is the INSERT SQL string that includes IF NOT EXISTS , where $sql_output is an int $SQL_UPDATE = "BEGIN IF NOT EXISTS (SELECT CONVERT(VARCHAR(12), GETDATE(), 107) as Date_to_Display FROM dbo.Download WHERE dbo.Download.Date_of_Download = GETDATE()) BEGIN INSERT INTO dbo.Download VALUES (convert(date, GETDATE(), 100),$sql_output) END END" And this is the code that attempts to

Throw Exception, message passed into constructor won't appear in PHP error

大兔子大兔子 提交于 2019-12-11 20:25:05
问题 I have a given class with some methods in it, one of which throws an exception as per the following when certain faulty criteria is met: PHP if ($this->mode !== null) { throw new LogicException('Nem kezdhető új "insert" utasítás.'); } If I do not handle this error, PHP will show the "Fatal Error" message as expected, but not the custom message that was passed into the first parameter of the constructor of LogicException : Fatal error : in /home/uxxxxxxxxx/public_html/test.php on line 87 I

Trying to cast an Image to a BufferedImage

戏子无情 提交于 2019-12-11 20:15:58
问题 I'm writing java code for a game and when creating the health bars I saw an exception that confused me greatly. The code and stack is below: Code: package com.teamanubiz.pixelhero; import java.awt.Graphics; import java.awt.Image; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import com.teamanubiz.gameapi.gfx.Sprite; public class GUIRenderLayer { public void renderStatBar(GUIPosition pos,