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>
40 lines
881 B
Text
40 lines
881 B
Text
"""
|
|
Error classes for pdftract subprocess SDK.
|
|
Auto-generated - do not edit manually.
|
|
"""
|
|
|
|
|
|
class PdftractError(Exception):
|
|
"""Base error class for all pdftract errors."""
|
|
|
|
def __init__(self, message: str, exit_code: int):
|
|
self.exit_code = exit_code
|
|
super().__init__(message)
|
|
|
|
|
|
{% for error in errors %}
|
|
{% if error.exit_code != 0 and error.exit_code != 10 %}
|
|
class {{ error.exception_name }}(PdftractError):
|
|
"""
|
|
{{ error.description }}
|
|
"""
|
|
|
|
def __init__(self, message: str, exit_code: int):
|
|
super().__init__(message, exit_code)
|
|
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% for error in errors %}
|
|
{% if error.exit_code == 10 %}
|
|
class {{ error.exception_name }}(PdftractError):
|
|
"""
|
|
{{ error.description }}
|
|
"""
|
|
|
|
def __init__(self, message: str, exit_code: int):
|
|
super().__init__(message, exit_code)
|
|
|
|
|
|
{% endif %}
|
|
{% endfor %}
|