Add error handling to dns-resolver example