1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.api.technical.elasticsearch
21 
22 import com.sksamuel.elastic4s.ElasticError
23 
24 final case class ElasticException(message: String) extends RuntimeException(message) {
25   def this(elasticError: ElasticError) =
26     this(s"${elasticError.reason} ${elasticError.causedBy.map(_.toString)}")
27 
28   def this(elasticError: ElasticError, relatedRequest: String) =
29     this(s"${elasticError.reason} ${elasticError.causedBy.map(_.toString)}\nCaused by request: $relatedRequest ")
30 }
Line Stmt Id Pos Tree Symbol Tests Code
26 8038 967 - 967 Literal <nosymbol> ()
26 8401 967 - 1039 Apply org.make.api.technical.elasticsearch.ElasticException.<init> ElasticException.this.<init>(("".+(elasticError.reason).+(" ").+(elasticError.causedBy.map[String](((x$1: com.sksamuel.elastic4s.ElasticError.CausedBy) => x$1.toString()))): String))
29 8472 1110 - 1110 Literal <nosymbol> ()
29 8815 1110 - 1219 Apply org.make.api.technical.elasticsearch.ElasticException.<init> ElasticException.this.<init>(("".+(elasticError.reason).+(" ").+(elasticError.causedBy.map[String](((x$2: com.sksamuel.elastic4s.ElasticError.CausedBy) => x$2.toString()))).+("\nCaused by request: ").+(relatedRequest).+(" "): String))