Retrieve the last error message.

Namespace:  FirmaSAT
Assembly:  diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.50.0.29531

Syntax

C#
public static string LastError()
Visual Basic (Declaration)
Public Shared Function LastError As String

Return Value

Error message from last call (may be empty)

Remarks

Call this immediately when an error is indicated. Calling another method will overwrite the message. This is the same as General.LastError().

Examples

CopyC#
// Attempt to sign but input file does not comply with CFDi specifications
int n = satSignXml("cfdv33a-out.xml", "cfdv33a-badspec.xml", "emisor.key", "12345678a", "emisor.cer");
Console.WriteLine("Error {0}: {1}", n, Sat.ErrorLookup(n));
// Error -10: Required data not found/Datos necesarios no encontrados (MISSING_ERROR)
Console.WriteLine(Sat.LastError());
// Attribute 'Importe' is mandatory/Atributo es obligatorio

See Also