Alter the error logic handling

Add some good examples to contrib/example.sh as well.