forked from Jaime-alv/into-parquet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppException.scala
37 lines (27 loc) · 1.09 KB
/
AppException.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* IntoParquet Copyright (c) 2024 Jaime Alvarez
*/
package com.github.jaime.intoParquet.exception
sealed trait AppException extends Exception {
self: Throwable =>
val message: String
override def getMessage: String = message
}
class NotImplementedTypeException(val invalidType: String) extends AppException {
override val message: String = s"Not recognized type conversion for $invalidType"
}
class EnrichNotImplementedTypeException(val file: String, invalidType: String)
extends NotImplementedTypeException(invalidType) {
override def getMessage: String =
s"""There is a problem with table description for file <$file>:
|${super.getMessage}""".stripMargin
}
class WrongInputArgsException extends AppException {
override val message: String = s"Input args parameters exception"
}
class NoFileFoundException(directory: String) extends AppException {
override val message: String = s"No csv files found in: <$directory>"
}
class NoSchemaFoundException(e: String) extends AppException {
override val message: String = s"No schema found for ${e}"
}