丰富错误栈信息
curl --request POST \
--url 'https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"type": "browser",
"service": "my-web-app",
"version": "1.0.0",
"stack": "TypeError: Cannot read properties of undefined\n at render (https://cdn.example.com/app.min.js:1:2345)",
"near": 3
}
'import requests
url = "https://api.flashcat.cloud/sourcemap/stack/enrich?app_key="
payload = {
"type": "browser",
"service": "my-web-app",
"version": "1.0.0",
"stack": "TypeError: Cannot read properties of undefined
at render (https://cdn.example.com/app.min.js:1:2345)",
"near": 3
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'browser',
service: 'my-web-app',
version: '1.0.0',
stack: 'TypeError: Cannot read properties of undefined\n at render (https://cdn.example.com/app.min.js:1:2345)',
near: 3
})
};
fetch('https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'browser',
'service' => 'my-web-app',
'version' => '1.0.0',
'stack' => 'TypeError: Cannot read properties of undefined
at render (https://cdn.example.com/app.min.js:1:2345)',
'near' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/sourcemap/stack/enrich?app_key="
payload := strings.NewReader("{\n \"type\": \"browser\",\n \"service\": \"my-web-app\",\n \"version\": \"1.0.0\",\n \"stack\": \"TypeError: Cannot read properties of undefined\\n at render (https://cdn.example.com/app.min.js:1:2345)\",\n \"near\": 3\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"browser\",\n \"service\": \"my-web-app\",\n \"version\": \"1.0.0\",\n \"stack\": \"TypeError: Cannot read properties of undefined\\n at render (https://cdn.example.com/app.min.js:1:2345)\",\n \"near\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"browser\",\n \"service\": \"my-web-app\",\n \"version\": \"1.0.0\",\n \"stack\": \"TypeError: Cannot read properties of undefined\\n at render (https://cdn.example.com/app.min.js:1:2345)\",\n \"near\": 3\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"frames": [
{
"function": "renderCheckout",
"file": "src/pages/checkout.tsx",
"line": 42,
"column": 17,
"converted": true,
"code_snippets": [
{
"line": 41,
"code": "const cart = props.cart;"
},
{
"line": 42,
"code": "return cart.items.map(renderItem);"
}
],
"original_frame": {
"function": "render",
"file": "https://cdn.example.com/app.min.js",
"line": 1,
"column": 2345
}
}
]
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}RUM Sourcemap
丰富错误栈信息
对 Browser、Android、iOS、小程序或 HarmonyOS 错误栈进行符号化或反混淆。
POST
/
sourcemap
/
stack
/
enrich
丰富错误栈信息
curl --request POST \
--url 'https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"type": "browser",
"service": "my-web-app",
"version": "1.0.0",
"stack": "TypeError: Cannot read properties of undefined\n at render (https://cdn.example.com/app.min.js:1:2345)",
"near": 3
}
'import requests
url = "https://api.flashcat.cloud/sourcemap/stack/enrich?app_key="
payload = {
"type": "browser",
"service": "my-web-app",
"version": "1.0.0",
"stack": "TypeError: Cannot read properties of undefined
at render (https://cdn.example.com/app.min.js:1:2345)",
"near": 3
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'browser',
service: 'my-web-app',
version: '1.0.0',
stack: 'TypeError: Cannot read properties of undefined\n at render (https://cdn.example.com/app.min.js:1:2345)',
near: 3
})
};
fetch('https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'browser',
'service' => 'my-web-app',
'version' => '1.0.0',
'stack' => 'TypeError: Cannot read properties of undefined
at render (https://cdn.example.com/app.min.js:1:2345)',
'near' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/sourcemap/stack/enrich?app_key="
payload := strings.NewReader("{\n \"type\": \"browser\",\n \"service\": \"my-web-app\",\n \"version\": \"1.0.0\",\n \"stack\": \"TypeError: Cannot read properties of undefined\\n at render (https://cdn.example.com/app.min.js:1:2345)\",\n \"near\": 3\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"browser\",\n \"service\": \"my-web-app\",\n \"version\": \"1.0.0\",\n \"stack\": \"TypeError: Cannot read properties of undefined\\n at render (https://cdn.example.com/app.min.js:1:2345)\",\n \"near\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/sourcemap/stack/enrich?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"browser\",\n \"service\": \"my-web-app\",\n \"version\": \"1.0.0\",\n \"stack\": \"TypeError: Cannot read properties of undefined\\n at render (https://cdn.example.com/app.min.js:1:2345)\",\n \"near\": 3\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"frames": [
{
"function": "renderCheckout",
"file": "src/pages/checkout.tsx",
"line": 42,
"column": 17,
"converted": true,
"code_snippets": [
{
"line": 41,
"code": "const cart = props.cart;"
},
{
"line": 42,
"code": "return cart.items.map(renderItem);"
}
],
"original_frame": {
"function": "render",
"file": "https://cdn.example.com/app.min.js",
"line": 1,
"column": 2345
}
}
]
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}限制说明
| 项目 | 说明 |
|---|---|
| 速率限制 | 每个账户 1,000 次/分钟;50 次/秒 |
| 权限要求 | 无 —— 持有有效的 app_key 即可调用 |
使用说明
- 为兼容旧调用,省略
type时默认按browser处理。 - 设置 1 到 20 之间的
near可在转换后的栈帧附近返回源码片段。 - Android NDK native 崩溃需传入
arch和source_type: ndk,后端会路由到 native 符号化逻辑。 - iOS 崩溃栈需传入
binary_images,以便按上传的 dSYM 文件重定位地址。 no_cache主要用于调试,会绕过已缓存的 enrich 结果。
授权
在 Flashduty 控制台 账户 → APP Key 中签发的 app_key。调用任何公开 API 时都必须携带。它等同于所属账户的身份凭证,请妥善保管。
请求体
application/json
错误栈 enrich 请求。
上传 Sourcemap 时使用的应用或服务名称。
上传 Sourcemap 时使用的应用版本。
来源平台。省略时默认按 browser 处理。
可用选项:
browser, android, ios, miniprogram, harmony 待解析和 enrich 的原始错误栈。
在转换后的栈帧附近返回的有效源码行数。
必填范围:
1 <= x <= 20跳过缓存的 enrich 结果,主要用于调试。
Gradle 插件 1.13.0 及以后版本使用的 Android build ID。
旧版 Gradle 插件使用的 Android build variant。
Android NDK 架构,例如 arm、arm64、x86 或 x64。
Android 错误来源类型;native 符号化时配合 arch 传入 ndk。
iOS 崩溃报告中的已加载 binary image 列表。
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I