mirror of
https://github.com/nitezs/sub2sing-box.git
synced 2024-12-23 21:44:41 -05:00
23 lines
458 B
Go
Executable File
23 lines
458 B
Go
Executable File
package parser
|
|
|
|
type ParseError struct {
|
|
Type ParseErrorType
|
|
Message string
|
|
Raw string
|
|
}
|
|
|
|
type ParseErrorType string
|
|
|
|
const (
|
|
ErrInvalidPrefix ParseErrorType = "invalid url prefix"
|
|
ErrInvalidStruct ParseErrorType = "invalid struct"
|
|
ErrInvalidPort ParseErrorType = "invalid port number"
|
|
)
|
|
|
|
func (e *ParseError) Error() string {
|
|
if e.Message != "" {
|
|
return string(e.Type) + ": " + e.Message + " \"" + e.Raw + "\""
|
|
}
|
|
return string(e.Type)
|
|
}
|