瀏覽代碼

Simplify error message

customisations
alemart 1 年之前
父節點
當前提交
b9511e0a26

+ 2
- 2
demos/hello-aframe/demo.js 查看文件

8
 {
8
 {
9
     if(!Martins.isSupported()) {
9
     if(!Martins.isSupported()) {
10
         throw new Error(
10
         throw new Error(
11
-            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
12
-            'Your user agent is ' + navigator.userAgent
11
+            'This device is not compatible with AR.\n\n' +
12
+            'User agent: ' + navigator.userAgent
13
         );
13
         );
14
     }
14
     }
15
 
15
 

+ 2
- 2
demos/hello-three/demo.js 查看文件

107
     {
107
     {
108
         if(!Martins.isSupported()) {
108
         if(!Martins.isSupported()) {
109
             throw new Error(
109
             throw new Error(
110
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
111
-                'Your user agent is ' + navigator.userAgent
110
+                'This device is not compatible with AR.\n\n' +
111
+                'User agent: ' + navigator.userAgent
112
             );
112
             );
113
         }
113
         }
114
 
114
 

+ 2
- 2
demos/hello-webgl/demo.js 查看文件

912
     {
912
     {
913
         if(!Martins.isSupported()) {
913
         if(!Martins.isSupported()) {
914
             throw new Error(
914
             throw new Error(
915
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
916
-                'Your user agent is ' + navigator.userAgent
915
+                'This device is not compatible with AR.\n\n' +
916
+                'User agent: ' + navigator.userAgent
917
             );
917
             );
918
         }
918
         }
919
 
919
 

+ 2
- 2
demos/hello-world/demo.js 查看文件

23
     {
23
     {
24
         if(!Martins.isSupported()) {
24
         if(!Martins.isSupported()) {
25
             throw new Error(
25
             throw new Error(
26
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
27
-                'Your user agent is ' + navigator.userAgent
26
+                'This device is not compatible with AR.\n\n' +
27
+                'User agent: ' + navigator.userAgent
28
             );
28
             );
29
         }
29
         }
30
 
30
 

+ 2
- 2
demos/touch-three/demo.js 查看文件

137
     {
137
     {
138
         if(!Martins.isSupported()) {
138
         if(!Martins.isSupported()) {
139
             throw new Error(
139
             throw new Error(
140
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
141
-                'Your user agent is ' + navigator.userAgent
140
+                'This device is not compatible with AR.\n\n' +
141
+                'User agent: ' + navigator.userAgent
142
             );
142
             );
143
         }
143
         }
144
 
144
 

+ 8
- 8
docs/getting-started/activate-your-webcam.md 查看文件

11
 {
11
 {
12
     if(!Martins.isSupported()) {
12
     if(!Martins.isSupported()) {
13
         throw new Error(
13
         throw new Error(
14
-            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
15
-            'Your user agent is ' + navigator.userAgent
14
+            'This device is not compatible with AR.\n\n' +
15
+            'User agent: ' + navigator.userAgent
16
         );
16
         );
17
     }
17
     }
18
 
18
 
156
 {
156
 {
157
     if(!Martins.isSupported()) {
157
     if(!Martins.isSupported()) {
158
         throw new Error(
158
         throw new Error(
159
-            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
160
-            'Your user agent is ' + navigator.userAgent
159
+            'This device is not compatible with AR.\n\n' +
160
+            'User agent: ' + navigator.userAgent
161
         );
161
         );
162
     }
162
     }
163
 
163
 
202
 {
202
 {
203
     if(!Martins.isSupported()) {
203
     if(!Martins.isSupported()) {
204
         throw new Error(
204
         throw new Error(
205
-            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
206
-            'Your user agent is ' + navigator.userAgent
205
+            'This device is not compatible with AR.\n\n' +
206
+            'User agent: ' + navigator.userAgent
207
         );
207
         );
208
     }
208
     }
209
 
209
 
256
 {
256
 {
257
     if(!Martins.isSupported()) {
257
     if(!Martins.isSupported()) {
258
         throw new Error(
258
         throw new Error(
259
-            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
260
-            'Your user agent is ' + navigator.userAgent
259
+            'This device is not compatible with AR.\n\n' +
260
+            'User agent: ' + navigator.userAgent
261
         );
261
         );
262
     }
262
     }
263
 
263
 

+ 2
- 2
docs/getting-started/next-steps.md 查看文件

13
 {
13
 {
14
     if(!Martins.isSupported()) {
14
     if(!Martins.isSupported()) {
15
         throw new Error(
15
         throw new Error(
16
-            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
17
-            'Your user agent is ' + navigator.userAgent
16
+            'This device is not compatible with AR.\n\n' +
17
+            'User agent: ' + navigator.userAgent
18
         );
18
         );
19
     }
19
     }
20
 
20
 

+ 8
- 8
docs/getting-started/set-up-the-session.md 查看文件

34
     try {
34
     try {
35
         if(!Martins.isSupported()) {
35
         if(!Martins.isSupported()) {
36
             throw new Error(
36
             throw new Error(
37
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
38
-                'Your user agent is ' + navigator.userAgent
37
+                'This device is not compatible with AR.\n\n' +
38
+                'User agent: ' + navigator.userAgent
39
             );
39
             );
40
         }
40
         }
41
 
41
 
65
     try {
65
     try {
66
         if(!Martins.isSupported()) {
66
         if(!Martins.isSupported()) {
67
             throw new Error(
67
             throw new Error(
68
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
69
-                'Your user agent is ' + navigator.userAgent
68
+                'This device is not compatible with AR.\n\n' +
69
+                'User agent: ' + navigator.userAgent
70
             );
70
             );
71
         }
71
         }
72
 
72
 
99
     try {
99
     try {
100
         if(!Martins.isSupported()) {
100
         if(!Martins.isSupported()) {
101
             throw new Error(
101
             throw new Error(
102
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
103
-                'Your user agent is ' + navigator.userAgent
102
+                'This device is not compatible with AR.\n\n' +
103
+                'User agent: ' + navigator.userAgent
104
             );
104
             );
105
         }
105
         }
106
 
106
 
162
 {
162
 {
163
     if(!Martins.isSupported()) {
163
     if(!Martins.isSupported()) {
164
         throw new Error(
164
         throw new Error(
165
-            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
166
-            'Your user agent is ' + navigator.userAgent
165
+            'This device is not compatible with AR.\n\n' +
166
+            'User agent: ' + navigator.userAgent
167
         );
167
         );
168
     }
168
     }
169
 
169
 

+ 4
- 4
docs/getting-started/set-up-the-tracker.md 查看文件

139
     try {
139
     try {
140
         if(!Martins.isSupported()) {
140
         if(!Martins.isSupported()) {
141
             throw new Error(
141
             throw new Error(
142
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
143
-                'Your user agent is ' + navigator.userAgent
142
+                'This device is not compatible with AR.\n\n' +
143
+                'User agent: ' + navigator.userAgent
144
             );
144
             );
145
         }
145
         }
146
 
146
 
180
     try {
180
     try {
181
         if(!Martins.isSupported()) {
181
         if(!Martins.isSupported()) {
182
             throw new Error(
182
             throw new Error(
183
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
184
-                'Your user agent is ' + navigator.userAgent
183
+                'This device is not compatible with AR.\n\n' +
184
+                'User agent: ' + navigator.userAgent
185
             );
185
             );
186
         }
186
         }
187
 
187
 

Loading…
取消
儲存