/**
 *   ______ .______   .______   .______    __  .__   __.  _______
 *  /      ||   _  \  |   _  \  |   _  \  |  | |  \ |  | |       \
 * |  ,----'|  |_)  | |  |_)  | |  |_)  | |  | |   \|  | |  .--.  |
 * |  |     |   ___/  |   ___/  |   _  <  |  | |  . `  | |  |  |  |
 * |  `----.|  |      |  |      |  |_)  | |  | |  |\   | |  '--'  |
 *  \______|| _|      | _|      |______/  |__| |__| \__| |_______/
 * 
 * This file is generated by cppbind on 07/21/2021-07:17.
 * Please do not change it manually.
 */

public class ExceptionHandler {

    static var uncaughtExceptionHandler = defaultHandler

    static func defaultHandler(_ err_msg: String) -> Never {
        print("Uncaught exception is found: \(err_msg)")
        fatalError("Unexpected Exception")
    }

    static func handleUncaughtException(_ err_msg : String) -> Never {
        uncaughtExceptionHandler(err_msg)
    }

    public static func setUncaughtExceptionHandler(_ handler: @escaping (String) -> Never) {
        uncaughtExceptionHandler = handler
    }

    public static func unsetUncaughtExceptionHandler() {
        uncaughtExceptionHandler = defaultHandler
    }
}
