Skip to content

Commit

Permalink
pool: improve err msg on mover create if protocol is not supported
Browse files Browse the repository at this point in the history
Motivation:
When a pool is missing SSL certificates and thus https is not supported, an
attempt to download a file via https will result in something like the following error message:
`Internal problem: Protocol Https-1.1:<client address>:<client port>:<door cell>:<door domain>:<path> is not supported`

This string includes much information in addition to the protocol, potentially making it difficult to understand the root cause.

Modification:
Improve logged message to mirror the other MoverProtocol mover creation exception messages and specifically
highlight the protocol itself.

Result:
Clearer error message when MoverProtocol mover creation fails due to an unsupported protocol (e.g. https)

Target: master
Addresses: RT 10478
Requires-notes: no
Requires-book: no
Patch: https://rb.dcache.org/r/14112/
Acked-by: Dmitry Litvintsev
  • Loading branch information
lemora committed Nov 10, 2023
1 parent 6412d58 commit ddb1720
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* dCache - http://www.dcache.org/
*
* Copyright (C) 2015 - 2020 Deutsches Elektronen-Synchrotron
* Copyright (C) 2015 - 2023 Deutsches Elektronen-Synchrotron
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -84,8 +84,10 @@ public Mover<?> createMover(ReplicaDescriptor handle, PoolIoFileMessage message,
throw new CacheException(CacheException.CANNOT_CREATE_MOVER, error,
cause);
} catch (ClassNotFoundException e) {
throw new CacheException(CacheException.CANNOT_CREATE_MOVER,
"Protocol " + info + " is not supported", e);
String error =
"Could not create MoverProtocol mover for " + info + " because protocol "
+ info.getVersionString() + " is not supported";
throw new CacheException(CacheException.CANNOT_CREATE_MOVER, error, e);
} catch (Exception e) {
Throwables.throwIfUnchecked(e);
String error = "Could not create MoverProtocol mover for " + info
Expand Down

0 comments on commit ddb1720

Please sign in to comment.