• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

handshake-org / hsd / 15042451478

15 May 2025 10:16AM UTC coverage: 19.792% (-51.5%) from 71.269%
15042451478

Pull #928

github

web-flow
Merge fa1d30da4 into 5f11d622b
Pull Request #928: Wallet coinselection

1570 of 13236 branches covered (11.86%)

Branch coverage included in aggregate %.

217 of 388 new or added lines in 6 files covered. (55.93%)

17866 existing lines in 127 files now uncovered.

7855 of 34384 relevant lines covered (22.84%)

129.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

4.76
/lib/script/scripterror.js
1
/*!
2
 * scripterror.js - script error for hsd
3
 * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
4
 * https://github.com/handshake-org/hsd
5
 */
6

7
'use strict';
8

9
/** @typedef {import('./opcode')} Opcode */
10

11
/**
12
 * Script Error
13
 * An error thrown from the scripting system,
14
 * potentially pertaining to Script execution.
15
 * @alias module:script.ScriptError
16
 * @extends Error
17
 * @property {String} message - Error message.
18
 * @property {String} code - Original code passed in.
19
 * @property {Number} op - Opcode.
20
 * @property {Number} ip - Instruction pointer.
21
 */
22

23
class ScriptError extends Error {
24
  /**
25
   * Create an error.
26
   * @constructor
27
   * @param {String} code - Error code.
28
   * @param {Opcode|String} [op] - Opcode.
29
   * @param {Number?} [ip] - Instruction pointer.
30
   */
31

32
  constructor(code, op, ip) {
UNCOV
33
    super();
×
34

UNCOV
35
    this.type = 'ScriptError';
×
UNCOV
36
    this.code = code;
×
UNCOV
37
    this.message = code;
×
UNCOV
38
    this.op = -1;
×
UNCOV
39
    this.ip = -1;
×
40

UNCOV
41
    if (typeof op === 'string') {
×
UNCOV
42
      this.message = op;
×
UNCOV
43
    } else if (op) {
×
UNCOV
44
      this.message = `${code} (op=${op.toSymbol()}, ip=${ip})`;
×
UNCOV
45
      this.op = op.value;
×
UNCOV
46
      this.ip = ip;
×
47
    }
48

UNCOV
49
    if (Error.captureStackTrace)
×
UNCOV
50
      Error.captureStackTrace(this, ScriptError);
×
51
  }
52
}
53

54
/*
55
 * Expose
56
 */
57

58
module.exports = ScriptError;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc