Skip to content

Commit

Permalink
stop the app for permission error (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 authored Dec 16, 2022
1 parent e9c6aad commit ddce430
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.vesoft.exchange.common.config.{
Type,
UserConfigEntry
}
import com.vesoft.nebula.ErrorCode
import org.apache.log4j.Logger

abstract class ServerBaseWriter extends Writer {
Expand Down Expand Up @@ -138,6 +139,10 @@ class NebulaGraphClientWriter(dataBaseConfigEntry: DataBaseConfigEntry,
return null
}
LOG.error(s"write vertex failed for ${result.getErrorMessage}")
if (result.getErrorCode == ErrorCode.E_BAD_PERMISSION.getValue) {
throw new RuntimeException(
s"write ${config.name} failed for E_BAD_PERMISSION: ${result.getErrorMessage}")
}
} else {
LOG.error(s"write vertex failed because write speed is too fast")
}
Expand All @@ -154,6 +159,10 @@ class NebulaGraphClientWriter(dataBaseConfigEntry: DataBaseConfigEntry,
return null
}
LOG.error(s"write edge failed for ${result.getErrorMessage}")
if (result.getErrorCode == ErrorCode.E_BAD_PERMISSION.getValue) {
throw new RuntimeException(
s"write ${config.name} failed for E_BAD_PERMISSION: ${result.getErrorMessage}")
}
} else {
LOG.error(s"write vertex failed because write speed is too fast")
}
Expand Down

0 comments on commit ddce430

Please sign in to comment.