mirror of
https://github.com/tursom/GoCollections.git
synced 2025-02-12 02:20:23 +08:00
add TypeCastException
This commit is contained in:
parent
143d28dcae
commit
8725d7b4a5
@ -12,8 +12,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/tursom/GoCollections/exceptions"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TypeCastException struct {
|
type TypeCastException struct {
|
||||||
@ -83,10 +81,6 @@ func ForceCast[T any](v unsafe.Pointer) *T {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TypeCastException) Cause() exceptions.Exception {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *TypeCastException) Error() string {
|
func (t *TypeCastException) Error() string {
|
||||||
return fmt.Sprintf("TypeCastException: %s\ncause by: %s", t.message, t.cause)
|
return fmt.Sprintf("TypeCastException: %s\ncause by: %s", t.message, t.cause)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user