implemented exception handling

*get exceptions from database