mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
Remove panic() and handle it appropriately (#5807)
This is an effort to remove panic from the source. Add a new call called CriticialIf, that calls LogIf and exits. Replace panics with one of CriticalIf, FatalIf and a return of error.
This commit is contained in:
@@ -35,7 +35,10 @@ func (u URL) IsEmpty() bool {
|
||||
func (u URL) String() string {
|
||||
// if port number 80 and 443, remove for http and https scheme respectively
|
||||
if u.Host != "" {
|
||||
host := MustParseHost(u.Host)
|
||||
host, err := ParseHost(u.Host)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
switch {
|
||||
case u.Scheme == "http" && host.Port == 80:
|
||||
fallthrough
|
||||
|
||||
Reference in New Issue
Block a user