Skip to content

Commit f08516e

Browse files
committed
Treat all client errors as setup errors when opening channel
Snowflake responds with a 4xx response code for various reasons when opening a channel: - User does not have permissions (403) - This table type does not support channels (400) - There are probably others I have not seen yet! Before this PR, if we treated the 403 as a setup error, but actually all 4xxs are probably setup errors. We should treat them gracefully by staying alive and sending an informative message to the monitoring webhook.
1 parent 4650893 commit f08516e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/core/src/main/scala/com.snowplowanalytics.snowplow.snowflake/processing/SnowflakeRetrying.scala

+5-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ object SnowflakeRetrying {
5959

6060
/** Is an error associated with setting up Snowflake as a destination */
6161
private def isSetupError[F[_]: Sync](t: Throwable): F[Boolean] = t match {
62-
case CausedByIngestResponseException(ire) if ire.getErrorCode === 403 =>
63-
true.pure[F]
62+
case CausedByIngestResponseException(ire) =>
63+
if (ire.getErrorCode >= 400 && ire.getErrorCode < 500)
64+
true.pure[F]
65+
else
66+
false.pure[F]
6467
case _: SecurityException =>
6568
// Authentication failure, i.e. user unrecognized or bad private key
6669
true.pure[F]

0 commit comments

Comments
 (0)