historyErrors.r.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 // ------------------------------------------------------------
11 // This file is included by both .h/cpp and .r files
12 // ------------------------------------------------------------
13 
14 #include <DgnPlatform/DgnPlatformErrors.r.h> // for DGNOPEN_STATUS_BASE
15 
16 // Generic cache errors that may be returned by history
17 #define HISTORY_ERROR_COMPLEX_COMPONENT DGNMODEL_STATUS_ComplexComponent /* "You cannot undo/redo historic changes to an individual complex component" */
18 #define HISTORY_ERROR_DGNCACHE_IS_IN_USE DGNMODEL_STATUS_IsInUse /* "Cannot delete model because it is currently in use" */
19 #define HISTORY_ERROR_BAD_ELEMENT DGNMODEL_STATUS_BadElement /* "An element cannot be updated. It is probably a complex component." */
20 
21 // Generic file I/O errors that may be returned by history and reported to the user
22 #define HISTORY_ERROR_COULD_NOT_OPEN_FILE_READWRITE (DGNOPEN_STATUS_BASE + 0x03) /* "Another user has temporarily locked the design file." Occurs when trying to open a file read-write. */
23 #define HISTORY_ERROR_COULD_NOT_REOPEN_FILE_READWRITE (DGNFILE_ERROR_BASE + 0x12) /* (effectively same as above, except that error occurs when trying to RE-open a read-only file as read-write) */
24 #define HISTORY_ERROR_ACCESS_VIOLATION (DGNOPEN_STATUS_BASE + 0x04) /* "The history file is not accessible by the current user" */
25 #define _DGNOPEN_STATUS_FILE_ALREADY_EXISTS (DGNOPEN_STATUS_BASE + 0x06)
26 #define _DGNOPEN_STATUS_FILE_NOT_FOUND (DGNOPEN_STATUS_BASE + 0x11)
27 #define HISTORY_ERROR_BAD_FILENAME (DGNOPEN_STATUS_BASE + 0x07) /* "Invalid filename" */
28 #define HISTORY_ERROR_DGNFILE_IS_ENCRYPTED (DGNOPEN_STATUS_BASE + 0x21) /* DGNOPEN_STATUS_IsEncrypted */
29 
30 #define HISTORY_ERROR_HISTORY_NOT_FOUND _DGNOPEN_STATUS_FILE_NOT_FOUND /* "History file not found" */
31 #define HISTORY_ERROR_HISTORY_ALREADY_EXISTS _DGNOPEN_STATUS_FILE_ALREADY_EXISTS /* "History already exists" (history_create) */
32 
33 #define HISTORY_ERROR_FILE_NOT_OPEN_READ_WRITE (DGNFILE_ERROR_BASE + 0x2) /* "The design file is read-only." (this usually only happens after we fail to get the write lock) */
34 
35 // Other history-specific error codes
36 #define HISTORY_ERROR_FIRST (DGNHISTORY_ERROR_BASE + 0x01) /* "First history error code */
37 #define HISTORY_ERROR_NOCHANGES (DGNHISTORY_ERROR_BASE + 0x01) /* "No changes were found" (history_commit, commitToShared, mergeFromShared) */
38 #define HISTORY_ERROR_NOT_A_DGN_FILE (DGNHISTORY_ERROR_BASE + 0x02) /* "This is not a V8 design file." (history_create) */
39 #define HISTORY_ERROR_CACHE_NOT_FOUND (DGNHISTORY_ERROR_BASE + 0x03) /* "Cannot restore element because its model is currently deleted." */
40 #define HISTORY_ERROR_PERMISSION_DENIED (DGNHISTORY_ERROR_BASE + 0x04) /* "Permission denied" (MS_DESIGN_HISTORY config variable is not set to allow this operation) */
41 #define HISTORY_ERROR_MISSING_LEVEL (DGNHISTORY_ERROR_BASE + 0x05) /* "Cannot restore element because its level is currently deleted." */
42 #define HISTORY_ERROR_DGN_FILE_NOT_FOUND (DGNHISTORY_ERROR_BASE + 0x06) /* "The design file was not found" */
43 #define HISTORY_ERROR_INVALID_REVISION_NUMBER (DGNHISTORY_ERROR_BASE + 0x07) /* "Invalid revision number. Must be of the form major.minor and must come after current tip revision number." */
44 #define HISTORY_ERROR_HAS_NEW_FEATURES (DGNHISTORY_ERROR_BASE + 0x08) /* "Design history was created or last updated by a newer version of MicroStation." */
45 #define HISTORY_ERROR_DUPLICATE_TAG (DGNHISTORY_ERROR_BASE + 0x09) /* "Tag is already defined */
46 #define HISTORY_ERROR_TAG_NOT_FOUND (DGNHISTORY_ERROR_BASE + 0x0A) /* "Tag is not defined" */
47 #define HISTORY_ERROR_TAG_NOT_REVISION (DGNHISTORY_ERROR_BASE + 0x0B) /* "Tag does not identify a revision" */
48 #define HISTORY_ERROR_BACKWARD_COMPATIBILITY (DGNHISTORY_ERROR_BASE + 0x0C) /* "The current operation would upgrade history, making it read-only to older versions of MicroStation." */
49 #define HISTORY_ERROR_REVISION_NOT_FOUND (DGNHISTORY_ERROR_BASE + 0x0D) /* "Revision not found." */
50 #define HISTORY_ERROR_FORWARD_COMPATIBILITY (DGNHISTORY_ERROR_BASE + 0x0E) /* "Design history is read-only, because it was last modified by a newer version of MicroStation." */
51 #define HISTORY_ERROR_NEEDS_COMMIT (DGNHISTORY_ERROR_BASE + 0x0F) /* "The design file has pending changes that must be committed first." */
52 #define HISTORY_ERROR_CORRUPT (DGNHISTORY_ERROR_BASE + 0x10) /* "Design history is in an inconsistent state." */
53 
54 #define HISTORY_ERROR_LAST (DGNHISTORY_ERROR_BASE + 0x10) /* "Last history error code." */
55 
56 #define IS_HISTORY_ERROR(s)\
57  HISTORY_ERROR_LAST >= (s) && (s) >= HISTORY_ERROR_FIRST
58 
59 #define IS_EXTENDED_HISTORY_ERROR(s)\
60  (s)==HISTORY_ERROR_COMPLEX_COMPONENT\
61  ||(s)==HISTORY_ERROR_DGNCACHE_IS_IN_USE\
62  ||(s)==HISTORY_ERROR_BAD_ELEMENT\
63  ||(s)==HISTORY_ERROR_COULD_NOT_OPEN_FILE_READWRITE\
64  ||(s)==HISTORY_ERROR_COULD_NOT_REOPEN_FILE_READWRITE\
65  ||(s)==HISTORY_ERROR_ACCESS_VIOLATION\
66  ||(s)==HISTORY_ERROR_BAD_FILENAME\
67  ||(s)==HISTORY_ERROR_DGNFILE_IS_ENCRYPTED\
68  ||(s)==HISTORY_ERROR_HISTORY_NOT_FOUND\
69  ||(s)==HISTORY_ERROR_HISTORY_ALREADY_EXISTS\
70  ||(s)==HISTORY_ERROR_FILE_NOT_OPEN_READ_WRITE
71 
72 /* Other error codes returned by history functions:
73 DGNHANDLERS_STATUS_BadArg - bad argument passed to function. E.g., sharedFileID or workfile name passed to client_createWorkfile was NULL or empty
74 */

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.