An error inside a klammer is reported at your document; the image search path

Assembled from development commit 632297b7657a. Since 1b00738: when something
goes wrong while a klammer is being applied, the report begins with the
line of your document that applied it, then lists the klammers being
applied and where inside the klammer set the fault was raised; the
Python binding's line and column are the application's too. The default
image search path is the document's directory, imgsrc beside it and
../imgsrc, and a not-found report shows exactly those.
This commit is contained in:
ack committed 2026-09-25 22:12:48 +02:00
1 parent 1b00738654
commit 5c29da52dc
9 files changed
+135 -15

No files matched your search

+15
View File
@@ -1,6 +1,8 @@
#pragma once
#include <string>
#include <utility>
#include <vector>
#include "locator.h"
@@ -27,9 +29,22 @@ public:
std::string message(const std::string& epilog="") const;
void print_message(const std::string& epilog="");
// Where the error is reported: the OUTERMOST klammer application it
// escaped through when there is one -- the place in the user's document
// -- else where it was raised. The commands' report headlines this and
// the Python binding's line/column are this (2026-09-25; before, an
// error raised inside a klammer's body, such as an @eval in
// sks/image/image.k, was located there and the document never named).
const Locator& location() const
{ return m_applications.empty() ? m_loc : m_applications.back().second; }
std::string m_type {};
std::string m_desc {};
Locator m_loc; // {};
// The klammer applications the error escaped through, innermost first:
// (name, where applied). Filled by Machine::apply_klammer_registry as
// the exception unwinds; message() prints the chain after the headline.
std::vector<std::pair<std::string, Locator>> m_applications {};
};