Options
All
  • Public
  • Public/Protected
  • All
Menu

Coverage Status Build Status npm

easy-e

built in hopes that I will better handle exceptions, it's easy

typescript-library-starter makes it so easy to publish to npm that I'd rather publish out of convenience, its amazing!

now in technicolor!

usage


import  Erric  from  'easy-e';
import { toastify } from 'react-toastify'



function  showPopUpWithMessage(msg) {
    // you do work, react-toastify is pretty good if you are using react, example:
    toastify.error(msg);
}



var  blogpost = { name: '#buildingTheWrongThing', medium: 'medium' }



if(!isSluggable(blogpost.name)){

validationError = new  Erric();

validationError.setCode('validation/blog/name/unsluggable');

validationError.setMessageForHumans('sorry, only letters and spaces!');

validationError.setMetadata({ input: blogpost.name })

validationError.alert(showPopupWithMessage);

[a  pretty  red  box pops up says  'sorry, only letters and spaces!](http://serveon.site/ez.gif)

validationError.throw();

Index

Variables

Const defaultErricCode

defaultErricCode: string = (() => 'erric/error-construction/default-error-code-not-overridden')()

Const defaultErricMessageForHumans

defaultErricMessageForHumans: string = (() => 'easy-e says: "no message for humans"!')()

Const defaultErricMetadata

defaultErricMetadata: object = (() => ({_defaultMetaDataFromErric: true,_tip: 'metadata can be any type'}))()

Type declaration

  • _defaultMetaDataFromErric: boolean
  • _tip: string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc