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

View File

@ -1,6 +1,6 @@
{
"name": "nodename-core",
"version": "0.1.4",
"version": "0.1.5",
"main": "lib/listener.js",
"types": "lib/listener.d.ts",
"author": "Fabian Stamm <dev@fabianstamm.de>",

View File

@ -190,11 +190,13 @@ export class Request implements Message {
this._header = <any>headerParser.parse(headerData);
this._header.AD = 0;
this._header.RCODE = ErrorCodes.NoError;
this._questions = parseQuestions(this._header.QDCOUNT, bodyData);
}
error(error: ErrorCodes) {
this._header.RCODE = error;
if (this._header.RCODE === ErrorCodes.NoError)
this._header.RCODE = error;
}
send() {