Raven 3.1.2 configured not to capture errors: DSN not set
时间: 2024-02-06 07:04:11 浏览: 455
这个错误是因为你在使用 Raven 3.1.2 的时候没有设置 DSN,导致 Raven 无法正常捕获错误信息。DSN 是一个用于标识你的 Sentry 项目的 URL,你需要在 Raven 的配置中设置它。
你可以在 Sentry 项目的设置页面中找到 DSN,将其复制到 Raven 的配置文件中,例如:
```python
import raven
client = raven.Client(dsn='https://public_key:secret_key@sentry.example.com/1')
```
其中,`public_key` 和 `secret_key` 是你 Sentry 项目的公钥和私钥,`sentry.example.com` 是你的 Sentry 服务器地址,`1` 是你的 Sentry 项目 ID。
设置好 DSN 后,Raven 就能够正常捕获错误信息并发送到 Sentry 服务器了。
相关问题
将如下bat脚本转换为shell脚本语言:@echo off set count=0 dir E:\ > nul 2>&1 if not %errorlevel% == 0 ( (echo E not exist) & pause && exit ) else ( (echo E exist) ) setlocal enabledelayedexpansion :loop for /f "skip=1 tokens=1" %%a in ('adb devices') do ( if not "%%a"=="List" ( set /a count+=1 ) ) if %count% gtr 0 ( echo found %count% devices goto end ) else ( echo device list is empty goto loop ) :end :read sn :: 将文件系统挂载为可写 adb root adb remount :: 获取当前时间戳,格式为yyyymmdd_hhmmss set timestamp=%date:~0,4%%date:~5,2%%date:~8,2%_%time:~0,2%%time:~3,2%%time:~6,2% :: 获取设备SN set retry_times=0 :get sn for /f "delims=" %%i in ('adb shell getprop ro.serialno') do set "devicesn=%%i" set /a "retry_times=retry_times+1" if not defined devicesn ( if %retry_times% leq 2 ( echo Failed to read device SN, try again. Retry count= %retry_times% goto :get sn ) else ( echo Failed to read device SN after multiple retries, please check the connection and try again later. pause && exit ) ) echo devicesn=%devicesn% timestamp=%timestamp% :: 以设备序列号和时间戳为文件夹名创建目录 set device_dir=%devicesn%_%timestamp% md "E:\Raven_DualCam\%device_dir%" && echo create "%device_dir%" success if %errorlevel% neq 0 ( echo create "%device_dir%" fail pause && exit ) :: 将指定的文件pull到E盘 adb pull /mnt/vendor/persist/camera/dualcam_cali.bin E:\Raven_DualCam\%device_dir%\dualcam_cali.bin adb pull /mnt/sdcard/DCIM/DoubleCam E:\Raven_DualCam\%device_dir%\DoubleCam pause
#!/bin/bash
count=0
ls /E > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "E not exist"
read -p "Press any key to continue..." -n1 -s
exit
else
echo "E exist"
fi
while true
do
count=0
for device in $(adb devices | awk 'NF==2{print $1}')
do
if [ $device != "List" ]
then
((count++))
fi
done
if [ $count -gt 0 ]
then
echo "found $count devices"
break
else
echo "device list is empty"
fi
done
devicesn=""
retry_times=0
while [ -z "$devicesn" ]
do
devicesn=$(adb shell getprop ro.serialno | tr -d '\r')
((retry_times++))
if [ -z "$devicesn" ]
then
if [ $retry_times -le 2 ]
then
echo "Failed to read device SN, try again. Retry count=$retry_times"
else
echo "Failed to read device SN after multiple retries, please check the connection and try again later."
read -p "Press any key to continue..." -n1 -s
exit
fi
fi
done
echo "devicesn=$devicesn"
timestamp=$(date +"%Y%m%d_%H%M%S")
echo "timestamp=$timestamp"
device_dir="$devicesn"_"$timestamp"
mkdir -p "/E/Raven_DualCam/$device_dir" && echo "create $device_dir success"
if [ $? -ne 0 ]
then
echo "create $device_dir fail"
read -p "Press any key to continue..." -n1 -s
exit
fi
adb root
adb remount
adb pull /mnt/vendor/persist/camera/dualcam_cali.bin "/E/Raven_DualCam/$device_dir/dualcam_cali.bin"
adb pull /mnt/sdcard/DCIM/DoubleCam "/E/Raven_DualCam/$device_dir/DoubleCam"
read -p "Press any key to continue..." -n1 -s
阅读全文