Skip to content

Commit

Permalink
Merge branch 'bugfix/IJMP-1954' into 'release/v2.0.2'
Browse files Browse the repository at this point in the history
IJMP-1954 Cert error message in tree has been truncated

See merge request ijmp/for-mainframe!628
  • Loading branch information
Katsiaryna Tsytsenia committed Dec 17, 2024
2 parents dee0202 + e183ef6 commit 82b4af4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ import eu.ibagroup.formainframe.utils.castOrNull
import eu.ibagroup.formainframe.utils.runIfTrue
import eu.ibagroup.formainframe.utils.runWriteActionInEdtAndWait
import eu.ibagroup.formainframe.utils.sendTopic
import java.security.cert.CertificateException
import java.time.LocalDateTime
import java.util.concurrent.locks.ReentrantLock
import javax.net.ssl.SSLPeerUnverifiedException
import kotlin.collections.set
import kotlin.concurrent.withLock

Expand Down Expand Up @@ -154,6 +156,11 @@ abstract class RemoteFileFetchProviderBase<Connection : ConnectionConfigBase, Re
sendTopic(FileFetchProvider.CACHE_CHANGES, dataOpsManager.componentManager).onFetchCancelled(query)
} else {
var errorMessage = throwable.message ?: "Error"

//The certificate error message has been truncated for prettier output.
if (throwable is SSLPeerUnverifiedException || throwable is CertificateException)
errorMessage = errorMessage.split("\n")[0].let { it.substring(0, it.length - 1) }

errorMessage = errorMessage.replace("\n", " ")
if (throwable is CallException) {
val details = throwable.errorParams?.get("details")
Expand Down

0 comments on commit 82b4af4

Please sign in to comment.