Created
March 19, 2025 21:19
-
-
Save homestar9/902add3d2043ccd5d87e5342c0537cbf to your computer and use it in GitHub Desktop.
Pre Advice Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function preCreate( event, rc, prc ) { | |
param rc.productId = ""; | |
if ( !isValid( "integer", rc.productId ) ) { | |
// this error should be caught by the aroundHandler, but does not! | |
throw( message="Bad Product", type="BadRequest" ); | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment