Skip to content

chore: improve error messaging when retrieve fails when response from ExecuteRetrievalPlan is invalid #228

@techfg

Description

@techfg

When executing the retrieve plan(s), the bytes are written to disk as-is, however the following errors can be encountered:

  1. Response body was empty - in this case, the CLI outputs the following error:
INFO[0000] Skuid CLI Version 0.6.7                      
INFO[0000] Starting Retrieve                   
INFO[0000] Authentication Successful                    
INFO[0000] Getting Retrieve Plan                        
INFO[0000] Got Retrieve Plan                            
INFO[0001] Target Directory is skuid-testsite  
WARN[0001] wrote nothing to tempfile                     error="didn't write anything"
ERRO[0001] error creating temporary file                 error="didn't write anything" fileName=
ERRO[0001] Error Encountered During Run: didn't write anything 
  1. Response body was not a well-formed/valid archive (zip) - In this case, the CLI outputs the following error:
INFO[0000] Skuid CLI Version 0.6.7                      
INFO[0000] Starting Retrieve                   
INFO[0000] Authentication Successful                    
INFO[0000] Getting Retrieve Plan                        
INFO[0000] Got Retrieve Plan                            
INFO[0001] Target Directory is skuid-testsite  
WARN[0001] unable to unzip archive                       error="zip: not a valid zip file"
WARN[0001] Error with UnzipArchive                       error="zip: not a valid zip file" fileName=/tmp/Skuid-NLX167523356 targetDirectoryFriendly=skuid-testsite
ERRO[0001] Error Encountered During Run: zip: not a valid zip file 

Both cases fall short of providing anything of meaningful error information to the user requiring them to utilize --diagnostic but even then, the error message won't mean anything. Both of these situations are easily identifiable in the code and the error message logged should provide more context/information to inform the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions