Disable Error overrides

This commit is contained in:
Fabian Stamm
2018-05-13 21:59:02 +02:00
parent 57c638316e
commit 68f44878d3
4 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const binary_parser_1 = require("binary-parser");
const types_1 = require("./types");
const MAX_LABEL_SIZE = 63;
var QueryTypes;
(function (QueryTypes) {
@ -152,6 +153,7 @@ class Request {
packet.copy(bodyData, 0, 12, packet.length);
this._header = headerParser.parse(headerData);
this._header.AD = 0;
this._header.RCODE = types_1.ErrorCodes.NoError;
this._questions = parseQuestions(this._header.QDCOUNT, bodyData);
}
get header() {
@ -161,7 +163,8 @@ class Request {
return this._questions.map(e => e);
}
error(error) {
this._header.RCODE = error;
if (this._header.RCODE === types_1.ErrorCodes.NoError)
this._header.RCODE = error;
}
send() {
this.sendCallback(this.serialize());

File diff suppressed because one or more lines are too long