User Tools

Site Tools


tinkerrors

Tink Errors

//basic error
throw new tink.core.Error("Something went wrong");
//using HTTP errors
throw new tink.core.Error(NotFound,"Resource not found");
//custom error codes
throw new Error(666,"Devil is in the detail");
//error carrying typed payload
 
enum MyErrorEnum {
    CatWalkedOnKeyboard(num:Int);
    UnpluggedWire(fl:Float,str:String);
    FireInRoom;
}
 
throw TypedError.typed(500,"Ouch",UnpluggedWire(0.3,"oops"));

More infos here

tinkerrors.txt · Last modified: 2018/09/26 09:15 by fbarbut