Indeed, it looks like a shortcoming in the current Artifactory. The more
common use case is for properties to be assigned via REST and this sample
will correctly return a bad request (400) response to REST clients. I have
created an issue <https://issues.jfrog.org/jira/browse/RTFACT-5429> to
catch the CancelException for UI-assigned properties.
Thanks for reporting this!
Yoav

On Sat, Jan 26, 2013 at 3:12 AM, sbartolic <[email protected]>wrote:

> In the example below it is expected that exception message is shown in
> Artifactory with a orange bar and the message. I have used the
> CancelException in other storage events such as beforeCreate and it works
> fine. However, the below example with Artifactory Pro 2.6.6 simply shows in
> the GUI as internal error and causes the user plugin to fail.
> beforePropertyCreate { item, name, values -> echo "Before setting property
> ${name} to ${values} on ${item.repoPath}" //Reject property names shorter
> than 4 chars if (name?.length() < 4) { throw new CancelException("Property
> name is too short", 400) } } Is this a bug?
> ------------------------------
> View this message in context: User
> Plugin-->Storage-->BeforePropertyCreate CancelException not working as
> expected<http://forums.jfrog.org/User-Plugin-Storage-BeforePropertyCreate-CancelException-not-working-as-expected-tp7578511.html>
> Sent from the Artifactory - Users mailing list 
> archive<http://forums.jfrog.org/Artifactory-Users-f2377369.html>at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnnow-d2d
> _______________________________________________
> Artifactory-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/artifactory-users
>
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Artifactory-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/artifactory-users

Reply via email to