Skip to content

Instantly share code, notes, and snippets.

@justmoon
justmoon / custom-error.js
Last active April 22, 2024 17:19 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@carlo-rtr
carlo-rtr / DropwizardDAOTest
Created November 15, 2012 21:35
DAO Testing with Dropwizard hibernate
package com.rtr.infra.wizard.test;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.context.internal.ManagedSessionContext;
import org.junit.After;
import org.junit.Before;
public abstract class DropwizardDAOTest {