pulumi/pkg/util/contract/fail.go
2017-06-26 14:46:34 -07:00

19 lines
434 B
Go

// Copyright 2016-2017, Pulumi Corporation. 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...)))
}