Merge pull request #711 from corda/shams-retryableexception

Made RetryableExeption a FlowException and reverted UnknownFix to be …
This commit is contained in:
Shams Asari 2017-05-23 13:56:54 +01:00 committed by GitHub
commit b8755ccdb2
2 changed files with 3 additions and 9 deletions

View File

@ -9,6 +9,7 @@ import com.google.common.util.concurrent.*
import net.corda.core.crypto.SecureHash import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.newSecureRandom import net.corda.core.crypto.newSecureRandom
import net.corda.core.crypto.sha256 import net.corda.core.crypto.sha256
import net.corda.core.flows.FlowException
import net.corda.core.serialization.CordaSerializable import net.corda.core.serialization.CordaSerializable
import org.slf4j.Logger import org.slf4j.Logger
import rx.Observable import rx.Observable
@ -32,13 +33,7 @@ import java.util.zip.Deflater
import java.util.zip.ZipEntry import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream import java.util.zip.ZipInputStream
import java.util.zip.ZipOutputStream import java.util.zip.ZipOutputStream
import kotlin.collections.Iterable
import kotlin.collections.LinkedHashMap import kotlin.collections.LinkedHashMap
import kotlin.collections.List
import kotlin.collections.filter
import kotlin.collections.firstOrNull
import kotlin.collections.fold
import kotlin.collections.forEach
import kotlin.concurrent.withLock import kotlin.concurrent.withLock
import kotlin.reflect.KProperty import kotlin.reflect.KProperty
@ -281,7 +276,7 @@ class ThreadBox<out T>(val content: T, val lock: ReentrantLock = ReentrantLock()
* We avoid the use of the word transient here to hopefully reduce confusion with the term in relation to (Java) serialization. * We avoid the use of the word transient here to hopefully reduce confusion with the term in relation to (Java) serialization.
*/ */
@CordaSerializable @CordaSerializable
abstract class RetryableException(message: String) : Exception(message) abstract class RetryableException(message: String) : FlowException(message)
/** /**
* A simple wrapper that enables the use of Kotlin's "val x by TransientProperty { ... }" syntax. Such a property * A simple wrapper that enables the use of Kotlin's "val x by TransientProperty { ... }" syntax. Such a property

View File

@ -7,7 +7,6 @@ import net.corda.core.crypto.DigitalSignature
import net.corda.core.crypto.MerkleTreeException import net.corda.core.crypto.MerkleTreeException
import net.corda.core.crypto.keys import net.corda.core.crypto.keys
import net.corda.core.crypto.sign import net.corda.core.crypto.sign
import net.corda.core.flows.FlowException
import net.corda.core.flows.FlowLogic import net.corda.core.flows.FlowLogic
import net.corda.core.identity.Party import net.corda.core.identity.Party
import net.corda.core.math.CubicSplineInterpolator import net.corda.core.math.CubicSplineInterpolator
@ -235,7 +234,7 @@ object NodeInterestRates {
} }
// TODO: can we split into two? Fix not available (retryable/transient) and unknown (permanent) // TODO: can we split into two? Fix not available (retryable/transient) and unknown (permanent)
class UnknownFix(val fix: FixOf) : FlowException("Unknown fix: $fix") class UnknownFix(val fix: FixOf) : RetryableException("Unknown fix: $fix")
/** Fix container, for every fix name & date pair stores a tenor to interest rate map - [InterpolatingRateMap] */ /** Fix container, for every fix name & date pair stores a tenor to interest rate map - [InterpolatingRateMap] */
class FixContainer(val fixes: Set<Fix>, val factory: InterpolatorFactory = CubicSplineInterpolator) { class FixContainer(val fixes: Set<Fix>, val factory: InterpolatorFactory = CubicSplineInterpolator) {