Some error management for the server.

A random server crash happens on my linux server so I will try to see if I can catch an exception.