• This repository has been archived on 08/Apr/2019
  • Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 11 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

hapi plugin for handling uncaught exceptions

poop Logo

hapi plugin for taking a process dump and cleaning up after an uncaught exception

Current Version Build Status

Lead Maintainer: Colin Ihrig

Table of Contents

Overview

When an uncaughtException is encountered a heap dump will be output to the plugin folder. A log file is also written containing the exception details. After this is complete the process will exit with a failure code. Heap dumps can also be taken at arbitrary times by sending a SIGUSR1 signal to the server process.

Example

The following example shows how to register and configure poop. In this example, an uncaught exception is thrown after poop is registered. This will trigger a heap dump and poop.log file to be created.

'use strict';
var Path = require('path');
var Hapi = require('hapi');
var Poop = require('poop');
var server = new Hapi.Server();

server.register({
    register: Poop,
    options: {
        logPath: Path.join(__dirname, 'poop.log')
    }
}, function () {

    throw new Error('uncaught');
});

Settings

The following options are available when configuring poop.

heapdumpFolder

The directory to place heap dump files. Defaults to the process current working directory.

logPath

The file path to log any uncaught exception errors. Defaults to poop.log in the process current working directory.

writeStreamOptions

Options passed to the write stream of the log file. Uses Node's defaults:

{
    flags: 'w',
    encoding: null,
    fd: null,
    mode: 0666
}

More Repositories

1

oz

Web Authorization Protocol
JavaScript
1,532
star
2

postmile

Collaborative list making tool written in Node.js
JavaScript
405
star
3

university

Community learning experiment
JavaScript
374
star
4

lout

API documentation generator
JavaScript
277
star
5

metaphor

Open Graph, Twitter Card, and oEmbed Metadata Collector
JavaScript
230
star
6

tv

Interactive debug console
CSS
186
star
7

hapijs.com

The hapijs.com website
JavaScript
183
star
8

bassmaster

Batch request plugin for hapi
JavaScript
139
star
9

discuss

The "mailing list"
99
star
10

sntp

SNTP client (RFC4330) for node
JavaScript
82
star
11

hapi-contrib

Discussion forum for project contributors
78
star
12

rejoice

hapi.js CLI
JavaScript
64
star
13

penseur

Lightweight RethinkDB wrapper
JavaScript
62
star
14

hapi-auth-hawk

Hawk authentication plugin
JavaScript
47
star
15

scarecrow

Oz authentication plugin
JavaScript
45
star
16

postmile-api

Postmile API Server
JavaScript
43
star
17

reptile

Plugin for creating a REPL
JavaScript
23
star
18

postmile-web

Postmile Web server
JavaScript
18
star
19

mailback

Turns incoming emails to callbacks
JavaScript
15
star
20

catbox-mongodb

MongoDB adapter for catbox (hapi caching)
JavaScript
15
star
21

fireworks

@nodeconf July 4th Fireworks
JavaScript
13
star
22

lobotomy

Replace endpoints with temporary or permanent handlers
JavaScript
5
star
23

bananas

Minimal Loggly hapi plugin
JavaScript
5
star
24

radix62

Convert and parse numbers in base62
JavaScript
4
star
25

require-graphql

Adds GraphQL schema file support to require()
JavaScript
4
star
26

while

Random joi shotcuts
JavaScript
4
star
27

hippocampus

Redis-based object cache with change feed
JavaScript
3
star
28

tarnish

Turn a bunch of buffers into a tar buffer
JavaScript
2
star
29

apiece

Stream-like callback function
JavaScript
2
star
30

feud

Family Fued Website
JavaScript
1
star
31

marker

Cross modules and cross versions shared symbols
JavaScript
1
star