Extracting of jenkins error

৪৫টি ভিউ
প্রথম অপঠিত মেসেজটিতে চলে আসুন

james prakash

পড়া হয়নি,
১৯ জানু, ২০২১, ৫:১৪:০৮ AM১৯/১/২১
প্রাপক Jenkins Users
How to find specific errors from jenkins console output and print them by echo statement 

Victor Martinez

পড়া হয়নি,
১৯ জানু, ২০২১, ৮:২১:৫৯ AM১৯/১/২১
প্রাপক Jenkins Users
There are different approaches but need more information, can you elaborate? 

james prakash

পড়া হয়নি,
১৯ জানু, ২০২১, ১:১৩:১২ PM১৯/১/২১
প্রাপক Jenkins Users
For example I made a missing of closing statement " } " in my pipeline script as shown below
cats2.jpg



Which  produces the error in jenkins console output as shown below 
cats1.jpg


So I want to print out the wrong statement in my jenkins output (using echo ) along with buildnumber ,build outcome as shown below .


catsw.jpg

For example in this particular build it should say expecting '}', found '' @ line 23, column 1. 

Victor Martinez

পড়া হয়নি,
২০ জানু, ২০২১, ৮:০৫:৫৯ AM২০/১/২১
প্রাপক Jenkins Users
I understand now, thanks.

I'm afraid in your case the issue is related to a syntax error in the Pipeline so nothing about a runtime error, so there is no way to run any echo as you want.

Though If I recall the Text Area field had a syntax validation, but I cannot find if that's true or something I just wrongly said. I might need to dig a bit deeper, so I'll comment here if I can find something.

In any case, if you use pipeline script from SCM definition then you could benefit of the linting in your local environment:

james prakash

পড়া হয়নি,
২১ জানু, ২০২১, ১:৫৭:৫৬ AM২১/১/২১
প্রাপক Jenkins Users
Thanks alot for your help @victor
সকলকে উত্তর দিন
লেখককে লিখে পাঠান
ফরওয়ার্ড করুন
0টি নতুন মেসেজ