1 // Copyright 2022-present 650 Industries. All rights reserved.
2 
3 /**
4  The exception that needs some additional parameters to be best described.
5  */
6 open class GenericException<ParamType>: Exception {
7   /**
8    The additional parameter passed to the initializer.
9    */
10   public let param: ParamType
11 
12   /**
13    The default initializer that takes a param and captures the place in the code where the exception was created.
14    - Warning: Call it only with one argument! If you need to pass more parameters, use a tuple instead.
15    */
16   public init(_ param: ParamType, file: String = #fileID, line: UInt = #line, function: String = #function) {
17     self.param = param
18     super.init(file: file, line: line, function: function)
19   }
20 }
21