mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -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:
@@ -168,7 +168,7 @@ func pathJoin(elem ...string) string {
|
||||
func mustGetUUID() string {
|
||||
uuid, err := uuid.New()
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Random UUID generation failed. Error: %s", err))
|
||||
logger.CriticalIf(context.Background(), err)
|
||||
}
|
||||
|
||||
return uuid.String()
|
||||
|
||||
Reference in New Issue
Block a user