Why is there “Unknown error” in real life? [duplicate]

As a programmer, I always try my best to explain what happened in the code when I have to show an error message, for example:

try {
    int a = b / 0;
} catch (NumberFormatException ex) {
    System.out.println("There was a problem with the number: " + ex.getMessage());
}

I think this is a very basic practice that everyone should follow. But in real life, we still see some “unknown” errors with no error code nor anything we could follow to find the reason, like this one, or this one.

I mean, every “error” has a reason, so why there is “Unknown error”? Can anyone explain this for me?

0

Because whoever was in charge of the information system didn’t consider it worthwhile to preserve this information.

That is the basic reason in all such cases. However, many different motives can be behind that assumption (and in fact, they can be both reasonable and unreasonable).

  • Someone didn’t think that anything could go wrong at all. It is rare for developers to be aware of all the things that can go wrong, and some don’t have any awareness of the potential for exceptional conditions except the ones they have themselves encountered.

  • They didn’t think that preserving the information was worth the additional effort. Using try on every action that might throw exceptions is a horrible strain on readability, and the information that is preserved may often be completely unintellegible to the average user anyway.

  • Increasingly, people work on isolated parts of large systems and don’t have the information they would need to do this. With internet-deployed systems, very often the details of an error that caused a failure of service never leave the server on which it occurred. Any code running on a different machine is then fundamentally unable to explain the problem.

  • The full details are not the thing you would want to know. A division by zero is intuitively understandable, but the vast majority of exception stack traces are ultimately caused by variations of ‘resourceManager is null‘. It’s technically true, but it doesn’t help you at all with understanding or resolving the problem. Is the resourceManager supposed to be nullable (i.e. is my code faulty, or theirs)? How do I get a valid resourceManager? Did this happen because I accessed something to early? How can I avoid that? Do I even need a resource manager, or is that module a part of the system that I shouldn’t be using in the first place? All these and thousands of other questions are not answered by an exception stack trace no matter how meticulously you report it, so maybe preserving the specifics of the error condition athand is not as useful as other mitigation measures would be.

Computer programs as they grow on a large scale, become very complex. They act according to very precise logic (machine instructions), and there are many environmental factors which can affect this logic and change its direction.

Then sometimes we just [can] catch an error has occurred and to understand the reason needs a deep analysis of the software and even operating system and maybe a lot of time.

You may have noticed that many scenarios are possible for an small program, such scenarios grow exponentially when the software get larger and links to Operating System or I/O devices.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật