Skip to content

Instantly share code, notes, and snippets.

if (dao.selectLabel(labelName).isEmpty) {
try {
dao.createLabel(labelName)
} catch {
case e =>
if (dao.selectLabel(labelName).isEmpty) {
throw new Exception(s"Failed to create label: $labelName", e)
}
}
}