Github user nickwallen commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1208#discussion_r224110745
  
    --- Diff: 
metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts 
---
    @@ -81,26 +81,28 @@ export class PcapPanelComponent implements OnInit, 
OnDestroy {
         this.pdml = null;
         this.progressWidth = 0;
         this.errorMsg = null;
    -    this.submitSubscription = 
this.pcapService.submitRequest(pcapRequest).subscribe((submitResponse: 
PcapStatusResponse) => {
    -      let id = submitResponse.jobId;
    -      if (!id) {
    -        this.errorMsg = submitResponse.description;
    -        this.queryRunning = false;
    -      } else {
    -        this.startPolling(id);
    +    this.subscriptions['submitSubscription'] = 
this.pcapService.submitRequest(pcapRequest).subscribe(
    +      (submitResponse: PcapStatusResponse) => {
    +        let id = submitResponse.jobId;
    +        if (!id) {
    +          this.errorMsg = submitResponse.description;
    +          this.queryRunning = false;
    +        } else {
    +          this.startPolling(id);
    +        }
    +      }, (error: any) => {
    +        this.errorMsg = `Response message: ${error.message}. Something 
went wrong with your query submission!`;
    --- End diff --
    
    Why do we not need to unsubscribe here like we do for 'statusSubscription' 
and 'cancelSubscription'?
    ```
    this.subscriptions['submitSubscription'].unsubscribe();
    ```


---

Reply via email to