File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,8 @@ type Run struct {
4242func (r * Run ) Text () (string , error ) {
4343 r .lock .Lock ()
4444 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- }
4845
49- return r .output , nil
46+ return r .output , r . Err ()
5047}
5148
5249// 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 {
6259
6360// Err returns the error that caused the gptscript to fail, if any.
6461func (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
6666}
6767
6868// Program returns the gptscript program for the run.
You can’t perform that action at this time.
0 commit comments