Skip to content

Instantly share code, notes, and snippets.

@desttinghim
Created October 28, 2017 21:59
Show Gist options
  • Save desttinghim/71ff9833fda5f198e320ec695fcc56d1 to your computer and use it in GitHub Desktop.
Save desttinghim/71ff9833fda5f198e320ec695fcc56d1 to your computer and use it in GitHub Desktop.
ISSUE-21: sig_geterror() documentation

DESCRIPTION

This call retrieves the error code from the signature, which can be passed to opendkim.get_errorstr to get a string describing the error. This function uses the signature handle found by opendkim.get_signature() to pull the selector from. Internally, this function calls opendkim.get_signature(), so there is no need to explicitly call it yourself.

ARGUMENTS

Type: undefined

RETURN VALUES

  • throws an error if there is no signature on the message.
  • returns an integer representing one of the possible error values.

NOTES

  • none

EXAMPLE

try {
  var opendkim = new OpenDKIM();

  opendkim.verify({id: undefined});
  opendkim.chunk({
    message: message,
    length: message.length
  });
  opendkim.chunk_end();
  var error = opendkim.sig_geterror();
  if (error != 0) {
    throw error; 
  }
} catch (err) {
  console.log(err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment