Skip to content

Commit 7e42a13

Browse files
vue error boundary work --- in progress
1 parent 6c9996b commit 7e42a13

File tree

14 files changed

+27888
-13
lines changed

14 files changed

+27888
-13
lines changed

example/browser/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ document.addEventListener("DOMContentLoaded", () => {
8989
});
9090
});
9191

92-
function throwIndexOutOfRange(indexer, withCustomStacking) {
92+
async function throwIndexOutOfRange(indexer, withCustomStacking) {
9393
try {
9494
getNonexistentData(indexer);
9595
} catch (e) {
9696
if (withCustomStacking) {
9797
if (Math.random() < 0.5) {
98-
Exceptionless.createException(e)
98+
await Exceptionless.createException(e)
9999
.setManualStackingKey("MyCustomStackingKey")
100100
.submit();
101101
} else {
102-
Exceptionless.createException(e)
102+
await Exceptionless.createException(e)
103103
.setManualStackingInfo(
104104
{
105105
File: "index.js",
@@ -110,7 +110,7 @@ function throwIndexOutOfRange(indexer, withCustomStacking) {
110110
.submit();
111111
}
112112
} else {
113-
Exceptionless.submitException(e);
113+
await Exceptionless.submitException(e);
114114
}
115115
}
116116
}

example/react/src/App.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ class App extends Component {
2828
this.setState({ error: true });
2929
};
3030

31-
submitMessage = () => {
31+
submitMessage = async () => {
3232
const message = "Hello, world!";
3333
this.setState({ message: "", errorInfo: "" });
34-
Exceptionless.submitLog(message);
34+
await Exceptionless.submitLog(message);
3535
this.setState({ message });
3636
};
3737

38-
tryCatchExample = () => {
38+
tryCatchExample = async () => {
3939
try {
4040
this.setState({ message: "", errorInfo: "" });
4141
throw new Error("Caught in the try/catch");
4242
} catch (error) {
4343
this.setState({ errorInfo: error.message });
44-
Exceptionless.submitException(error);
44+
await Exceptionless.submitException(error);
4545
}
4646
};
4747

example/vue/src/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<script setup>
22
import HelloWorld from './components/HelloWorld.vue'
3+
// import { Exceptionless, ExceptionlessErrorBoundary } from '@exceptionless/vue'
34
45
// This starter template is using Vue 3 experimental <script setup> SFCs
56
// Check out https://github.com/vuejs/rfcs/blob/script-setup-2/active-rfcs/0000-script-setup.md
67
</script>
78

89
<template>
910
<div>
10-
<HelloWorld msg="Exceptionless Vue Example" />
11+
12+
<HelloWorld msg="Exceptionless Vue Example" />
13+
1114
</div>
1215
</template>
1316

example/vue/src/components/HelloWorld.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ defineProps({
2727
2828
const state = reactive({ error: "" })
2929
30-
const throwError = () => {
30+
const throwError = async () => {
3131
try {
3232
throw new Error("Whoops, it broke");
3333
} catch (error) {
3434
state.error = error.message;
35-
Exceptionless.submitException(error);
35+
await Exceptionless.submitException(error);
3636
}
3737
}
3838
</script>

example/vue/src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { createApp } from "vue";
22
import App from "./App.vue";
3-
import { Exceptionless } from "@exceptionless/browser";
3+
import { Exceptionless } from "@exceptionless/vue";
44

5-
await Exceptionless.startup((c) => {
5+
Exceptionless.startup((c) => {
66
c.useDebugLogger();
77

88
c.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw";

packages/vue/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# Editor directories and files
17+
.idea
18+
.vscode
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw?

packages/vue/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# vue
2+
3+
## Project setup
4+
```
5+
npm install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
npm run serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
npm run build
16+
```
17+
18+
### Lints and fixes files
19+
```
20+
npm run lint
21+
```
22+
23+
### Customize configuration
24+
See [Configuration Reference](https://cli.vuejs.org/config/).

packages/vue/babel.config.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

packages/vue/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { Exceptionless, ExceptionlessErrorBoundary } from "./src/main";
2+
export { Exceptionless, ExceptionlessErrorBoundary };

0 commit comments

Comments
 (0)