pulumi/pkg/util/contract/fail.go
2017-03-14 19:26:14 -07:00

19 lines
420 B
Go

// Copyright 2017 Pulumi, Inc. All rights reserved.
package contract
import (
"fmt"
)
const failMsg = "A failure has occurred"
// Fail unconditionally abandons the process.
func Fail() {
failfast(failMsg)
}
// Failf unconditionally abandons the process, formatting and logging the given message.
func Failf(msg string, args ...interface{}) {
failfast(fmt.Sprintf("%v: %v", failMsg, fmt.Sprintf(msg, args...)))
}