add errors package

add errors package
add util functions for slice

add util functions for slice