Skip to content

Feature/output channel #557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 3, 2022
Prev Previous commit
Next Next commit
clenaup error messages
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Jan 2, 2022
commit efda471987b6d9bdeb03401218d23353e6d23bd8
2 changes: 1 addition & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const createCommands = (commandProps: CreateCommandProps): { [key: string
}
testRunner = createTestRunner(data, {
onSuccess: (position: T.Position) => {
logger('test pass position', position)
logger(`Test pass position: ${JSON.stringify(position)}`)
// send test pass message back to client
channel.context.position.set({ ...position, complete: true })
send({ type: 'TEST_PASS', payload: { position: { ...position, complete: true } } })
Expand Down
2 changes: 1 addition & 1 deletion src/services/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function saveCommit(message: string): Promise<never | void> {
logger(`Error: ${stderr}`)
throw new Error('Error saving progress to Git')
}
logger(stdout)
logger(`Commit saved: ${stdout}`)
}

export async function clear(): Promise<Error | void> {
Expand Down
2 changes: 1 addition & 1 deletion src/services/hooks/utils/runCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const runCommands = async (commands: string[] = []): Promise<void> => {
let result: { stdout: string; stderr: string }
try {
result = await exec({ command })
logger(result)
logger(`Command output: ${JSON.stringify(result)}`)
} catch (error: any) {
logger(`Command failed: ${error.message}`)
send({ type: 'COMMAND_FAIL', payload: { process: { ...process, status: 'FAIL' } } })
Expand Down
2 changes: 0 additions & 2 deletions src/services/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ export const deactivate = (): void => {
}

export const onError = (error: Error, properties?: Properties, measurements?: Measurements): void => {
logger(error, properties, measurements)
if (reporter) {
reporter.sendTelemetryException(error, properties, measurements)
}
}

export const onEvent = (eventName: string, properties?: Properties, measurements?: Measurements): void => {
logger(eventName, properties, measurements)
if (reporter) {
reporter.sendTelemetryEvent(eventName, properties, measurements)
}
Expand Down
4 changes: 2 additions & 2 deletions web-app/src/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const md: MarkdownIt = new MarkdownIt({
try {
hl = Prism.highlight(str, Prism.languages[lang], lang)
} catch (error: any) {
logger(`Error highlighing markdown: ${error.message}`)
logger(`Error highlighting markdown: ${error.message}`)
hl = md.utils.escapeHtml(str)
}

Expand Down Expand Up @@ -67,7 +67,7 @@ const Markdown = (props: Props) => {
} catch (error) {
const message = `Failed to parse markdown for ${props.children}`
// TODO: onError(new Error(message))
logger(message)
logger(`Error: ${message}`)
html = `<div style='background-color: #FFB81A; padding: 0.5rem;'>
<strong style='padding-bottom: 0.5rem;'>ERROR: Failed to parse markdown</strong>
<p>${props.children}</p>
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/components/Router/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const Router = ({ children, route }: RouterProps) => {
}
const message = `No Route matches for "${JSON.stringify(route)}"`
// TODO: onError(new Error(message))
logger(message)
logger(`Error: ${message}`)
return null
}

Expand Down