override fun parse()

in ses-plugin-server/src/main/kotlin/jetbrains/buildServer/sesPlugin/sqs/SQSNotificationParserImpl.kt [19:31]


    override fun parse(data: String): AmazonSQSNotificationParseResult<AmazonSQSNotification> {
        var res: AmazonSQSNotification?
        var ex: SQSNotificationParseException?
        try {
            res = gson.fromJson<AmazonSQSNotification>(data, AmazonSQSNotification::class.java)
            ex = validate(res, data)
        } catch (cause: Exception) {
            res = null
            ex = SQSNotificationParseException("Cannot parse data ($data)", cause)
        }

        return AmazonSQSNotificationParseResult(res, ex)
    }