Skip to content
Snippets Groups Projects
Commit 69ea2043 authored by Vitezslav Kriz's avatar Vitezslav Kriz
Browse files

hints: server stop when root hints load failed

If user provides custom hints file with config option hints.root_file('file')
resovler fail with error. Before it just silently pass and may fail
when loading defaults file, which leads to confusing error message.
parent 9bdfbdd8
No related branches found
No related tags found
1 merge request!413Fix confusing error messages regarding root hints
......@@ -27,6 +27,7 @@
#include <ccan/json/json.h>
#include <ucw/mempool.h>
#include <contrib/cleanup.h>
#include <lauxlib.h>
#include "daemon/engine.h"
#include "lib/zonecut.h"
......@@ -570,6 +571,9 @@ static char* hint_root_file(void *env, struct kr_module *module, const char *arg
struct engine *engine = env;
struct kr_context *ctx = &engine->resolver;
const char *err_msg = engine_hint_root_file(ctx, args);
if (err_msg) {
luaL_error(engine->L, "error when opening '%s': %s", args, err_msg);
}
return strdup(err_msg ? err_msg : "");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment