pdftract/templates/sdk-skeleton/swift/Sources/PdftractCodegen/Errors.swift.tera
jedarden 11257e7706 feat(pdftract-l993m): complete per-language Tera template scaffolding
Complete the Tera template scaffolding for all 8 subprocess-based SDKs
under templates/sdk-skeleton/<lang>/: node, go, java, dotnet, ruby,
php, swift, python-subprocess.

Each template directory contains:
- Package metadata template (package.json, go.mod, pom.xml, etc.)
- Method stubs template (methods.ts, client.go, Methods.java, etc.)
- Error stubs template (errors.ts, errors.go, Errors.java, etc.)
- Conformance runner template (conformance.test.ts, etc.)
- README template with {{ version }} variable substitution
- GENERATED.tera marker file

New files for python-subprocess:
- pdftract_subprocess/codegen/errors.py.tera
- tests/codegen/conformance_test.py.tera
- README.md.tera
- GENERATED.tera

All 8 language template directories are now complete and ready for
consumption by the `pdftract sdk codegen` subcommand.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-05-18 02:01:46 -04:00

45 lines
985 B
Text

//
// This file is auto-generated. Do not edit manually.
//
#if os(Linux)
import Foundation
#else
import Foundation
#endif
public class PdftractError: Error {
public let message: String
public let exitCode: Int
public init(_ message: String, _ exitCode: Int) {
self.message = message
self.exitCode = exitCode
}
public var localizedDescription: String {
return message
}
}
{% for error in errors %}
{% if error.exit_code != 0 and error.exit_code != 10 %}
/// {{ error.description }}
public class {{ error.exception_name }}: PdftractError {
public init(_ message: String, _ exitCode: Int) {
super.init(message, exitCode)
}
}
{% endif %}
{% endfor %}
{% for error in errors %}
{% if error.exit_code == 10 %}
/// {{ error.description }}
public class {{ error.exception_name }}: PdftractError {
public init(_ message: String, _ exitCode: Int) {
super.init(message, exitCode)
}
}
{% endif %}
{% endfor %}