Skip to content

Commit

Permalink
Merge branch 'main' into github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
muskansethi1 authored Jun 27, 2024
2 parents 7cf0bf9 + 498e2f3 commit ce3aef1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
The format is based on [Keep a Changelog](http://keepachangelog.com/).

## Version 1.1.3

### Changed

- Improved error handling


## Version 1.1.2

### Added
Expand Down
3 changes: 3 additions & 0 deletions lib/aws-s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const { SELECT } = cds.ql;
module.exports = class AWSAttachmentsService extends require("./basic") {
init() {
const creds = this.options.credentials;

if(!creds) throw new Error("SAP Object Store instance is not bound.");

this.bucket = creds.bucket;
this.client = new S3Client({
region: creds.region,
Expand Down
6 changes: 5 additions & 1 deletion lib/malwareScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ async function entryExists(Attachments, key) {


function getCredentials() {
return xsenv.serviceCredentials({ label: "malware-scanner" });
try {
return xsenv.serviceCredentials({ label: "malware-scanner" });
} catch (error) {
throw new Error("SAP Malware Scanning service is not bound.");
}
}

function streamToString(stream) {
Expand Down

0 comments on commit ce3aef1

Please sign in to comment.