一、使用try{}catch

val custom_id_b = try {
custom_domainMap(domain_b)
} catch {
cas



二、使用match{}case

val custom=custom_id_map.get(domain)
val custom_id_b=custom match {case Some(id)=>id case None=>"other"}