1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 14:04:36 +00:00

fix: re-attempt of request, hopefully fixes #400

This commit is contained in:
allan
2025-06-30 17:37:18 +01:00
parent 33a487b2b4
commit 542039b425
2 changed files with 13 additions and 2 deletions

View File

@@ -148,6 +148,6 @@ data _null_;
run;
/* END */
%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
*%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
%mend mp_replace;

View File

@@ -114,6 +114,17 @@ options noquotelenmax;
headers "Authorization"="Bearer &&&access_token_var";
%end;
run;
%if &SYS_PROCHTTP_STATUS_CODE=401 %then %do;
/* relates to: https://github.com/sasjs/core/issues/400 */
%put 401 thrown in &sysmacroname;
%put sleeping: %sysfunc(sleep(10,1)) - will try once more;
proc http method='GET' out=&fname1 &oauth_bearer
url="&base_uri/folders/folders/@item?path=&newpath";
%if &grant_type=authorization_code %then %do;
headers "Authorization"="Bearer &&&access_token_var";
%end;
run;
%end;
%local libref1;
%let libref1=%mf_getuniquelibref();
libname &libref1 JSON fileref=&fname1;
@@ -121,7 +132,7 @@ options noquotelenmax;
iftrue=(
&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 404
)
,mac=&sysmacroname
,mac=mv_createfolder124
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
)
%if &mdebug=1 %then %do;