|
75 | 75 | import edu.harvard.iq.dataverse.util.URLTokenUtil; |
76 | 76 | import edu.harvard.iq.dataverse.util.UrlSignerUtil; |
77 | 77 | import edu.harvard.iq.dataverse.util.json.JsonUtil; |
78 | | -import jakarta.json.JsonNumber; |
79 | | -import jakarta.json.JsonReader; |
80 | 78 | import jakarta.persistence.EntityManager; |
81 | 79 | import jakarta.persistence.PersistenceContext; |
82 | 80 | import jakarta.servlet.http.HttpServletRequest; |
83 | 81 | import jakarta.ws.rs.core.Response; |
84 | | -import org.apache.http.util.EntityUtils; |
85 | 82 |
|
86 | 83 | @Stateless |
87 | 84 | @Named("GlobusServiceBean") |
@@ -517,17 +514,19 @@ public GlobusTaskState getTask(String accessToken, String taskId, Logger globusL |
517 | 514 | } |
518 | 515 |
|
519 | 516 | if (result.status != 200) { |
520 | | - // @todo It should probably retry it 2-3 times before giving up; |
521 | | - // similarly, it should probably differentiate between a "no such task" |
522 | | - // response and something intermittent like a server/network error or |
523 | | - // an expired token... i.e. something that's recoverable (?) |
524 | | - // edit: yes, but, should be done outside of this method, in the code |
525 | | - // that uses it |
| 517 | + |
| 518 | + String failureReason; |
| 519 | + if (result.jsonResponse != null) { |
| 520 | + failureReason = result.jsonResponse; |
| 521 | + } else { |
| 522 | + failureReason = "unknown"; |
| 523 | + } |
| 524 | + |
526 | 525 | myLogger.warning("Cannot find information for the task " + taskId |
527 | 526 | + " status: " |
528 | 527 | + result.status |
529 | 528 | + " : Reason : " |
530 | | - + result.jsonResponse != null ? result.jsonResponse.toString() : "unknown" ); |
| 529 | + + failureReason); |
531 | 530 | } |
532 | 531 |
|
533 | 532 | if (result.status == 401) { |
@@ -1754,6 +1753,10 @@ public void processCompletedTask(GlobusTaskInProgress globusTask, |
1754 | 1753 | boolean deleteRule, |
1755 | 1754 | Logger taskLogger) { |
1756 | 1755 |
|
| 1756 | + if (globusTask.getDataset() == null) { |
| 1757 | + return; |
| 1758 | + } |
| 1759 | + |
1757 | 1760 | String ruleId = globusTask.getRuleId(); |
1758 | 1761 | Dataset dataset = globusTask.getDataset(); |
1759 | 1762 | AuthenticatedUser authUser = globusTask.getLocalUser(); |
|
0 commit comments