hammerspoon2-docs
    Preparing search index...

    Variable lastErrorConst

    lastError: { code: string; message: string } | null

    The error from the most recent failed hs.fs function, or null if none has failed. The object has a code (a POSIX error name such as "ENOENT", "EEXIST", or "EACCES", or "EINVAL" for invalid arguments) and a human-readable message. Like C's errno, it is not cleared by successful calls, so only consult it after a function has reported failure. Errors from methods on an open file are recorded on that file's own lastError instead.