mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
errors.Format
This commit is contained in:
@@ -2,7 +2,6 @@ package conf
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
@@ -46,14 +45,14 @@ func (v *KCPConfig) Build() (*loader.TypedSettings, error) {
|
||||
if v.Mtu != nil {
|
||||
mtu := *v.Mtu
|
||||
if mtu < 576 || mtu > 1460 {
|
||||
return nil, fmt.Errorf("KCP|Config: Invalid MTU size: %d", mtu)
|
||||
return nil, errors.Format("KCP|Config: Invalid MTU size: %d", mtu)
|
||||
}
|
||||
config.Mtu = &kcp.MTU{Value: mtu}
|
||||
}
|
||||
if v.Tti != nil {
|
||||
tti := *v.Tti
|
||||
if tti < 10 || tti > 100 {
|
||||
return nil, fmt.Errorf("KCP|Config: Invalid TTI: %d", tti)
|
||||
return nil, errors.Format("KCP|Config: Invalid TTI: %d", tti)
|
||||
}
|
||||
config.Tti = &kcp.TTI{Value: tti}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"v2ray.com/core/app/router"
|
||||
"v2ray.com/core/common/errors"
|
||||
"v2ray.com/core/tools/geoip"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
@@ -29,7 +30,7 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
panic(fmt.Errorf("Unexpected status %d", resp.StatusCode))
|
||||
panic(errors.Format("Unexpected status %d", resp.StatusCode))
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
scanner := bufio.NewScanner(resp.Body)
|
||||
|
||||
Reference in New Issue
Block a user