Nothing Special   »   [go: up one dir, main page]

Skip to content
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

Don't print backtraces for user/input errors #131

Merged
merged 1 commit into from
Apr 29, 2015

Conversation

sbc100
Copy link
Contributor
@sbc100 sbc100 commented Apr 27, 2015

This change introduces a common YapfError parent class
that can be used for input/user error. run_main() then
handles these errors and prints a nice error message
rather than a nasty backtrace (backtraces IMHO should
only be printed for program errors).

Fixes #130

@@ -11,3 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


class YapfError(Exception):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer we can put this in a new file called yapflib/error.py?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 91.89% when pulling 53c06d0 on sbc100:handle_errors into 8c7840c on google:master.

This change introduces a common YapfError parent class
that can be used for input/user error.  run_main() then
handles these errors and prints a nice error message
rather than a nasty backtrace (backtraces IMHO should
only be printed for program errors).

Fixes google#130
@sbc100
Copy link
Contributor Author
sbc100 commented Apr 28, 2015

Done.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 92.68% when pulling 4f6c195 on sbc100:handle_errors into 5e7c8aa on google:master.

eliben added a commit that referenced this pull request Apr 29, 2015
Don't print backtraces for user/input errors
@eliben eliben merged commit b34ff3c into google:master Apr 29, 2015
@sbc100 sbc100 deleted the handle_errors branch April 29, 2015 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yapf crashes with misggin style (e.g. --style=foo)
4 participants