Skip to content

Commit a0f29f3

Browse files
robkooperlmarini
andauthored
Small fixes (#225)
* return 404 not 500 * make sure connection is not None * add changelog Co-authored-by: Luigi Marini <[email protected]>
1 parent b97b1c1 commit a0f29f3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
- Added folder and folder id to api datasets files list [#34](https://github.com/clowder-framework/clowder/issues/34)
99

1010
### Fixed
11+
- RabbitMQ will not use connection if None exists
12+
- previews returns 404 if preview is not found
1113
- When uploading a file, it would ignore any extractors marked disabled at the space level. [#246](https://github.com/clowder-framework/clowder/issues/246)
1214
- Added index for comments, will speed up index creation
1315
- If using S3 storage in docker, it was not reflected correctly in the docker-compose file

app/api/Previews.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ class Previews @Inject()(previews: PreviewService, tiles: TileService) extends A
9393
}
9494
}
9595
}
96-
case None => Logger.error("No preview find " + id); InternalServerError("No preview found")
96+
case None => {
97+
Logger.error("No preview found " + id)
98+
NotFound("No preview found")
99+
}
97100
}
98101
}
99102

app/services/rabbitmq/RabbitMQMessageService.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ class RabbitMQMessageService extends MessageService {
234234
connect()
235235
var tempChannel: Channel = null
236236
try {
237-
tempChannel = connection.get.createChannel()
237+
tempChannel = connection match {
238+
case Some(c) => c.createChannel()
239+
case None => null
240+
}
238241
if (tempChannel != null) {
239242
tempChannel.exchangeDeclare(exchange, exchange_type, true)
240243

0 commit comments

Comments
 (0)