diff options
Diffstat (limited to 'builder/error.go')
-rw-r--r-- | builder/error.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/builder/error.go b/builder/error.go new file mode 100644 index 000000000..a6f59eb08 --- /dev/null +++ b/builder/error.go @@ -0,0 +1,25 @@ +package builder + +// MultiError is a list of multiple errors (actually: diagnostics) returned +// during LLVM IR generation. +type MultiError struct { + Errs []error +} + +func (e *MultiError) Error() string { + // Return the first error, to conform to the error interface. Clients should + // really do a type-assertion on *MultiError. + return e.Errs[0].Error() +} + +// commandError is an error type to wrap os/exec.Command errors. This provides +// some more information regarding what went wrong while running a command. +type commandError struct { + Msg string + File string + Err error +} + +func (e *commandError) Error() string { + return e.Msg + " " + e.File + ": " + e.Err.Error() +} |