error handling in delivery process

This will be extremely useful in case of dependencies on messages