Custom Exceptions in Clojure?

Rather than generating custom classes, there are two much simpler ways to use custom exceptions: Use slingshot – this provides custom throw+ and catch+ macros that let you throw and catch any object, as well as exceptions. In clojure 1.4 and above, you can use clojure.core/ex-info and clojure.core/ex-data to generate and catch a clojure.lang.ExceptionInfo class, … Read more

Exception: Concurrent modification during iteration: Instance(length:17) of ‘_GrowableList’

This error means that you are adding or removing objects from a collection during iteration. This is not allowed since adding or removing items will change the collection size and mess up subsequent iteration. The error is likely from one of these lines which you haven’t posted the source for: s.collisionResponse(e); e.collision(s); s.collision(e); I assume … Read more

Can I get detailed exception stacktrace in PowerShell?

There is a function up on the PowerShell Team blog called Resolve-Error which will get you all kinds of details Note that $error is an array of all the errors you have encountered in your PSSession. This function will give you details on the last error you encountered. function Resolve-Error ($ErrorRecord=$Error[0]) { $ErrorRecord | Format-List … Read more

Could not load file or assembly System.Net.Http.Primitives. Located assembly’s manifest definition does not match the assembly reference

I ran into the same issue with the Google API’s. The main issue here is if you install the Microsoft Http Client Libraries it puts in your project an updated version of the System.Net.Http.Primitives DLL. The web.config assumes you are still using the default version of 1.5. There are two things that need to happen … Read more

Spock – Testing Exceptions with Data Tables

The recommended solution is to have two methods: one that tests the good cases, and another that tests the bad cases. Then both methods can make use of data tables. Example: class SomeSpec extends Specification { class User { String userName } def ‘validate valid user'() { when: validateUser(user) then: noExceptionThrown() where: user << [ … Read more

Catching panics in Golang

A panicking program can recover with the builtin recover() function: The recover function allows a program to manage behavior of a panicking goroutine. Suppose a function G defers a function D that calls recover and a panic occurs in a function on the same goroutine in which G is executing. When the running of deferred … Read more

ASP.NET Web API: Non-descriptive 500 Internal Server Error

You can try adding: GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; to your Application_Start() in the Global.asax. This solution works for many of the common errors. If, however, you aren’t getting satisfactory information you should consider writing an l Exception Filter and registering it globally. This article should get you started. The core of what you need is to … Read more

Dart catch clause

Dart is an optional typed language. So the type of e is not required. you have to use the following syntax to catch only SomeException : try { // … } on SomeException catch(e) { //Handle exception of type SomeException } catch(e) { //Handle all other exceptions } See catch section of Dart: Up and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)