You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We extensively use ichiban/prolog for our okp4/okp4d protocol, and we have reached a point where there is a need to standardize the error representation of our custom predicates. This includes throwing exceptions such as permission_error and resource_error.
Issue
At present, the ichiban/prolog library allows custom predicates to raise exceptions such as TypeError and DomainError. However, it lacks the capability to raise PermissionError and ResourceError exceptions since the relevant functions are private (engine/exception.go#L294). Additionally, the NewException function, while seemingly useful, cannot capture the private current context (varContext), which is important.
Solution
A straightforward solution would be to make the functions responsible for creating exceptions like PermissionError and ResourceError accessible to developers by making them publicly available. However, I trust your judgment for making the final decision on the solution.
Thx
PS: I would be delighted to contribute if needed. Just let me know.
The text was updated successfully, but these errors were encountered:
I was sure that the developers will need TypeError and DomainError but unsure about other errors.
So I've been waiting for the requests. Let's add PermissionError and ResourceError If you need them!
I'll do it when I've got time (been busy moving) or you can make a PR and I'll happily merge it!
Context
We extensively use
ichiban/prolog
for our okp4/okp4d protocol, and we have reached a point where there is a need to standardize the error representation of our custom predicates. This includes throwing exceptions such as permission_error and resource_error.Issue
At present, the
ichiban/prolog
library allows custom predicates to raise exceptions such asTypeError
andDomainError
. However, it lacks the capability to raisePermissionError
andResourceError
exceptions since the relevant functions are private (engine/exception.go#L294). Additionally, the NewException function, while seemingly useful, cannot capture the private current context (varContext), which is important.Solution
A straightforward solution would be to make the functions responsible for creating exceptions like
PermissionError
andResourceError
accessible to developers by making them publicly available. However, I trust your judgment for making the final decision on the solution.Thx
PS: I would be delighted to contribute if needed. Just let me know.
The text was updated successfully, but these errors were encountered: