mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-11-10 00:10:36 +08:00
m
This commit is contained in:
parent
3a05165b5e
commit
83612a40c0
2 changed files with 14 additions and 1 deletions
|
|
@ -2238,6 +2238,16 @@ var DISABLE_REPEATED_DOMAIN_CHECK = { skip_fqdn_check: 'true' };
|
|||
// Go.
|
||||
|
||||
function rawrecordBuilder(type) {
|
||||
|
||||
// Record which line called this record type.
|
||||
// NB(tlim): Hopefully we can find a better way to do this in the
|
||||
// future. Right now we're faking that there was an error just to parse
|
||||
// out the line number. That's inefficient but I can't find anything better.
|
||||
// This will certainly break if we change to a different Javascript interpreter.
|
||||
// Hopefully any other interpreter will have a better way to do this.
|
||||
var positionLines = new Error().stack.split('\n');
|
||||
var position = positionLines[positionLines.length - 2];
|
||||
|
||||
return function () {
|
||||
// Copy the raw args:
|
||||
var rawArgs = [];
|
||||
|
|
@ -2248,6 +2258,7 @@ function rawrecordBuilder(type) {
|
|||
return function (d) {
|
||||
var record = {
|
||||
type: type,
|
||||
filepos: position,
|
||||
};
|
||||
|
||||
// Process the args: Functions are executed, objects are assumed to
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ func FromRaw(rc *models.RecordConfig, items []any) error {
|
|||
name = items[0].(string)
|
||||
code = items[1].(uint16)
|
||||
if code != 301 && code != 302 && code != 303 && code != 307 && code != 308 {
|
||||
return fmt.Errorf("code (%03d) is not 301,302,303,307,308", code)
|
||||
return fmt.Errorf("%s: code (%03d) is not 301,302,303,307,308", rc.FilePos, code)
|
||||
error: this is failing.
|
||||
`( dnsc && go install ) && dns && time dnscontrol check`
|
||||
}
|
||||
when = items[2].(string)
|
||||
then = items[3].(string)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue