refactored errorhandling of shuck server