File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,8 @@ type Run struct {
42
42
func (r * Run ) Text () (string , error ) {
43
43
r .lock .Lock ()
44
44
defer r .lock .Unlock ()
45
- if r .err != nil {
46
- return "" , fmt .Errorf ("run encounterd an error: %w with error output: %s" , r .err , r .errput )
47
- }
48
45
49
- return r .output , nil
46
+ return r .output , r . Err ()
50
47
}
51
48
52
49
// Bytes returns the output of the gptscript in bytes. It blocks until the output is ready.
@@ -62,7 +59,10 @@ func (r *Run) State() RunState {
62
59
63
60
// Err returns the error that caused the gptscript to fail, if any.
64
61
func (r * Run ) Err () error {
65
- return r .err
62
+ if r .err != nil {
63
+ return fmt .Errorf ("run encounterd an error: %w with error output: %s" , r .err , r .errput )
64
+ }
65
+ return nil
66
66
}
67
67
68
68
// Program returns the gptscript program for the run.
You can’t perform that action at this time.
0 commit comments