lide.error

[lide.core] ^0.01

This module is loaded with lide.core it’s part of framework into the lide.error module we will find the necessary functions to robust error handling implemented in Lua.

local try, catch = lide.error.try, lide.error.catch;

try { function( )
   ...
end,

catch { function( err )
   print(err);
end
}};

lide.error.try

Within this function we will put the piece of code that could have an error.
nil lide.error.try ( function try_code )

lide.error.catch

Optional Within this function we will put the code that will be executed in case of error.
nil lide.error.catch ( function catch_code ( Exception exception ) )

lide.error.finally

Optional Here we should put cleaning code
nil lide.error.finally ( function finally_code )

lide.error.is_string

Check if given value is type string
nil lide.error.is_string( value )

lide.error.is_number

Check if given value is type number
nil lide.error.is_number( value )

lide.error.is_table

Check if given value is type table
nil lide.error.is_table( value )

lide.error.is_function

Check if given value is type function
nil lide.error.is_function( value )

lide.error.is_boolean

Check if given value is type boolean
nil lide.error.is_boolean( value )

lide.error.is_object

Check if given value is type object
nil lide.error.is_object( value )

lide.error.newException

Create an exception
Exception lide.error.newException ( string sExceptionName, string sDefaultErrMsg )

lide.error.TypeError

Trhow an exception
nil lide.error.newException ( string sExceptionName, string sErrorMsg )