mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-21 17:10:14 +01:00
v0.5: fixed nil dereference for empty autocert config, fixed and simplified 'error' module, small readme and docs update
This commit is contained in:
@@ -11,5 +11,5 @@ func NewPath(s string) (Path, E.NestedError) {
|
||||
if s == "" || s[0] == '/' {
|
||||
return Path{F.NewStringable(s)}, E.Nil()
|
||||
}
|
||||
return Path{}, E.Invalid("path", s).Extra("must be empty or start with '/'")
|
||||
return Path{}, E.Invalid("path", s).With("must be empty or start with '/'")
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type StreamPort struct {
|
||||
func NewStreamPort(p string) (StreamPort, E.NestedError) {
|
||||
split := strings.Split(p, ":")
|
||||
if len(split) != 2 {
|
||||
return StreamPort{}, E.Invalid("stream port", p).Extra("should be in 'x:y' format")
|
||||
return StreamPort{}, E.Invalid("stream port", p).With("should be in 'x:y' format")
|
||||
}
|
||||
|
||||
listeningPort, err := NewPort(split[0])
|
||||
|
||||
Reference in New Issue
Block a user