Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8802

Re: How to raise a exception if the incoming value for a source field is empty

$
0
0

Hi,

 

If you want to raise a custom exception in mapping use the below udf.

 

Ex:id -->mapwithdefault-->udf-->id

 

if(!id.equals("")){return id;}

else{throw new StreamTransformationException("Source field \"id\" value is empty");}

 

As above said in your example it didn't throw default error because you are passing empty value(tag without any value).

It will throw error when you pass null value i.e (without tag )

 

 

Regards

Venkat


Viewing all articles
Browse latest Browse all 8802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>