File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -48,17 +48,20 @@ def main_code():
4848 log .debug (f"config: { config .to_dict ()} " )
4949 output_handler = OutputHandler (config )
5050
51+ # Validate API token
52+ if not config .api_token :
53+ log .info ("Socket API Token not found. Please set it using either:\n "
54+ "1. Command line: --api-token YOUR_TOKEN\n "
55+ "2. Environment variable: SOCKET_SECURITY_API_KEY" )
56+ sys .exit (3 )
57+
5158 sdk = socketdev (token = config .api_token )
5259 log .debug ("sdk loaded" )
5360
5461 if config .enable_debug :
5562 set_debug_mode (True )
5663 log .debug ("Debug logging enabled" )
5764
58- # Validate API token
59- if not config .api_token :
60- log .info ("Unable to find Socket API Token" )
61- sys .exit (3 )
6265
6366 # Initialize Socket core components
6467 socket_config = SocketConfig (
You can’t perform that action at this time.
0 commit comments