Skip to content

Conversation

@crowecawcaw
Copy link
Contributor

Fixes: #252

What was the problem/requirement? (What/Why)

If a job template's environment was None, the library threw an unexpected exception.

What was the solution? (How)

Catch this error and raise a ValueError properly.

What is the impact of this change?

Prevents unexpected errors from this library

How was this change tested?

Unit test

Was this change documented?

n/a

Is this a breaking change?

No

Does this change impact security?

No

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Add type check in _validate_has_script_or_variables to raise a proper
ValidationError when environment is None instead of AttributeError.

Signed-off-by: Stephen Crowe <[email protected]>
@sonarqubecloud
Copy link

@crowecawcaw crowecawcaw enabled auto-merge (squash) December 15, 2025 18:24
@crowecawcaw crowecawcaw merged commit 41b2494 into OpenJobDescription:mainline Dec 15, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AttributeError when decoding environment template with environment: None

3 participants