This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into kjuell/react-imports
- Loading branch information
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: How To Find Error Messages with Sourcegraph (Video) | ||
author: marek-zaluski | ||
tags: [video, search, sourcegraph] | ||
description: Learn about finding error messages in your code with Sourcegraph. | ||
image: /headers/how-to-find-error-messages-with-sourcegraph-thumbnail.jpg | ||
imageAlt: Marek talking about finding error messages with Sourcegraph. | ||
type: posts | ||
--- | ||
|
||
<EmbeddedYoutubeVideo id="M4zlcZJ2fOA" /> | ||
|
||
## Related links | ||
|
||
- [Sourcegraph code search](https://sourcegraph.com/search) | ||
- [Sourcegraph docs](https://docs.sourcegraph.com) | ||
- [Read about literal search patterns](/literal-search-patterns) | ||
- [Watch: Three Ways to Search with Sourcegraph (Video)](/three-ways-to-search-video) | ||
|
||
## Transcript | ||
|
||
Have you ever been faced with an error message and spent a really long time trying to figure out where it was coming from? | ||
|
||
My name is Marek. I'm an engineer at Sourcegraph. And I'm going to share with you my own error message story. | ||
|
||
A few months ago, I was working on a browser extension in Chrome. And I started seeing this unfamiliar message that I hadn't seen before. It looked something like this. "Extension context invalidated." What does that even mean? I didn't know where this error was being thrown. And I didn't know where to start looking. We were loading code from a few different repositories into this browser extension bundle. So I wasn't sure where this was coming from. | ||
|
||
At first, I tried doing some searches right in my editor to try to find an exact match for the text of this error message. But I got nowhere. I didn't find any matches in the repository that I had open at all. | ||
|
||
So I'll show you how I actually used Sourcegraph to do a code search that helped me find the answer. By default, Sourcegraph searches for code in literal search mode. That means it looks for an exact match. For an error message, this is pretty convenient. And I can show you by pasting that error message directly into the search box. Now, I don't need to surround this search with quotes, because literal search will by default already search for the entire thing. | ||
|
||
As soon as I get results, there's a hint about where this is coming from. And that's in the name of this repository that I'm getting. So I'm seeing chromium as the repository. This gives me a hint that this is part of the Chrome browser itself and actually not at all a part of the code base that I was working on. The chromium source code is in a public GitHub repository, and Sourcegraph searches over public code. This helped me save a lot of time and a lot of struggle to get to the bottom of this error message. And it turns out it was an issue with the way that the browser extension was being reloaded for development. | ||
|
||
Sourcegraph's default search mode is great for error messages like this, but if you're looking for patterns, you can also use regular expressions. And you can also use structural search. So you can take a look at our documentation to learn more about that. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+113 KB
public/headers/how-to-find-error-messages-with-sourcegraph-thumbnail.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.