Better error handling - just log for non-critical errors, custom exception for others.