@@ -4,6 +4,7 @@ import client from '../../apollo'
44import tutorialQuery from '../../apollo/queries/tutorial'
55import channel from '../../channel'
66import * as selectors from '../../selectors'
7+ import onError from 'services/sentry/onError'
78
89interface TutorialData {
910 tutorial : G . Tutorial
@@ -30,7 +31,9 @@ export default {
3031 initializeTutorial ( context : CR . MachineContext , event : CR . MachineEvent ) {
3132 // setup test runner and git
3233 if ( ! context . tutorial ) {
33- throw new Error ( 'Tutorial not available to load' )
34+ const error = new Error ( 'Tutorial not available to load' )
35+ onError ( error )
36+ throw error
3437 }
3538
3639 client
@@ -43,7 +46,9 @@ export default {
4346 } )
4447 . then ( result => {
4548 if ( ! result || ! result . data || ! result . data . tutorial ) {
46- return Promise . reject ( 'No tutorial returned from tutorial config query' )
49+ const message = 'No tutorial returned from tutorial config query'
50+ onError ( new Error ( message ) )
51+ return Promise . reject ( message )
4752 }
4853
4954 channel . editorSend ( {
@@ -52,7 +57,9 @@ export default {
5257 } )
5358 } )
5459 . catch ( ( error : Error ) => {
55- return Promise . reject ( `Failed to load tutorial config ${ error . message } ` )
60+ const message = `Failed to load tutorial config ${ error . message } `
61+ onError ( new Error ( message ) )
62+ return Promise . reject ( message )
5663 } )
5764 } ,
5865 continueConfig ( context : CR . MachineContext ) {
0 commit comments