Skip to content

Commit

Permalink
Add error handling
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
AjayvirS and coderabbitai[bot] authored Nov 22, 2024
1 parent c8f5301 commit eb2f004
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,19 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit {
}
blobParts.push(fields.join(';') + '\n');
});
try {
downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv');
} catch (error) {
console.error('Failed to download plagiarism cases:', error);
this.jhiAlertService.error('plagiarismCases.export.error');
}
import { JhiAlertService } from 'ng-jhipster';

constructor(
private plagiarismCasesService: PlagiarismCasesService,

Check failure on line 179 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-compilation

',' expected.

Check failure on line 179 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-compilation

',' expected.

Check failure on line 179 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests

',' expected.

Check failure on line 179 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests

',' expected.

Check failure on line 179 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests-selected

',' expected.

Check failure on line 179 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests-selected

',' expected.
private route: ActivatedRoute,

Check failure on line 180 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-compilation

',' expected.

Check failure on line 180 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-compilation

',' expected.

Check failure on line 180 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests

',' expected.

Check failure on line 180 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests

',' expected.

Check failure on line 180 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests-selected

',' expected.

Check failure on line 180 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests-selected

',' expected.
private jhiAlertService: JhiAlertService,

Check failure on line 181 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-compilation

',' expected.

Check failure on line 181 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-compilation

',' expected.

Check failure on line 181 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests

',' expected.

Check failure on line 181 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests

',' expected.

Check failure on line 181 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests-selected

',' expected.

Check failure on line 181 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests-selected

',' expected.
) {}

Check failure on line 182 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-compilation

';' expected.

Check failure on line 182 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests

';' expected.

Check failure on line 182 in src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts

View workflow job for this annotation

GitHub Actions / client-tests-selected

';' expected.

try {
downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv');
} catch (error) {
console.error('Failed to download plagiarism cases:', error);
this.jhiAlertService.error('plagiarismCases.export.error');
}
}
}

0 comments on commit eb2f004

Please sign in to comment.