Pipeline RestrictedAccessException from Sandbox cannot be approved

6 views
Skip to first unread message

Torsten Reinhard

unread,
Dec 8, 2016, 8:29:09 AM12/8/16
to Jenkins Users
Hi,

this code actually doesnt work in a Sandbox, because I´m not allowed to use new XmlSlurper() or its method setErrorHandler(....)

import groovy.util.XmlSlurper

node
("master") {
    stage
("1st Stage")
    git url
:"ssh://g...@licdci01.mycompany.net:7999/cd/deployment-configs.git", credentialsId: "Bitbucket_Access"

    stage
("2nd Stage")
   
try {
     
XmlSlurper slurper = new XmlSlurper()
      slurper
.setErrorHandler( null )
   
} catch( exc ) {
      error
( "something went wrong: ${exc}" )        
     
//throw new RuntimeException( "you were not allowed for ${exc}", exc)
   
}
}

I tried to approve the missing method
- but it didnt appear in the list when using Pipeline´s error(....) script.
Switching back to a re-thrown new RuntimeException( "...", exc) i could approve the classes, methods as expected.

For Sandbox code it looks like using error(....) isn´t a good approach, right ?

best regards
,

Torsten


Reply all
Reply to author
Forward
0 new messages